Mercurial > hg
diff tests/svnxml.py @ 46400:7525e77b5eac
convert: option to set date and time for svn commits
Converting to subversion repository is not preserving original commit dates as
it may break some subversion functionality if commit dates are not monotonically
increasing.
This patch adds `convert.svn.dangerous-set-commit-dates` configuration option
to change this behaviour and enable commit dates convertion for those who want
to take risks.
Subversion always uses commit dates with UTC timezone, so only timestamps
are used.
Test `test-convert-svn-sink.t` uses `svnxml.py` script to dump history of svn
repositories. Atm the script is not printing `date` field from svn log. This
patch changes this to allow checks on correctness of date and time convertion.
Documentation is updated. Additional test case is added to test commit dates
convertion.
Differential Revision: https://phab.mercurial-scm.org/D9721
author | Nikita Slyusarev <nslus@yandex-team.com> |
---|---|
date | Tue, 12 Jan 2021 00:11:16 +0300 |
parents | 2372284d9457 |
children | 6000f5b25c9b |
line wrap: on
line diff
--- a/tests/svnxml.py Fri Jan 15 23:58:41 2021 +0100 +++ b/tests/svnxml.py Tue Jan 12 00:11:16 2021 +0300 @@ -15,6 +15,7 @@ e['revision'] = entry.getAttribute('revision') e['author'] = xmltext(entry.getElementsByTagName('author')[0]) e['msg'] = xmltext(entry.getElementsByTagName('msg')[0]) + e['date'] = xmltext(entry.getElementsByTagName('date')[0]) e['paths'] = [] paths = entry.getElementsByTagName('paths') if paths: @@ -42,7 +43,7 @@ except AttributeError: fp = sys.stdout for e in entries: - for k in ('revision', 'author', 'msg'): + for k in ('revision', 'author', 'date', 'msg'): fp.write(('%s: %s\n' % (k, e[k])).encode('utf-8')) for path, action, fpath, frev in sorted(e['paths']): frominfo = b''