# HG changeset patch # User Mads Kiilerich # Date 1391790577 -3600 # Node ID 62153c5d1ce29dc1a545b62fdf374a68f053ea57 # Parent e61a8395c3c153c05e67af246e691b3d3beede55 convert: secret config option for disabling debugsvnlog Subversion issues involving svn log such as d54467c1a198 can be tricky to debug when it is run in an 'hg debugsvnlog' sub process. Debugging is simpler when convert only uses one process. With this change convert will invoke the svn log directly when setting [convert] svn.debugsvnlog = False This is intentionally not documented. diff -r e61a8395c3c1 -r 62153c5d1ce2 hgext/convert/subversion.py --- a/hgext/convert/subversion.py Fri Feb 07 17:28:37 2014 +0100 +++ b/hgext/convert/subversion.py Fri Feb 07 17:29:37 2014 +0100 @@ -174,6 +174,30 @@ self._stdout.close() self._stdout = None +class directlogstream(list): + """Direct revision log iterator. + This can be used for debugging and development but it will probably leak + memory and is not suitable for real conversions.""" + def __init__(self, url, paths, start, end, limit=0, + discover_changed_paths=True, strict_node_history=False): + + def receiver(orig_paths, revnum, author, date, message, pool): + paths = {} + if orig_paths is not None: + for k, v in orig_paths.iteritems(): + paths[k] = changedpath(v) + self.append((paths, revnum, author, date, message)) + + # Use an ra of our own so that our parent can consume + # our results without confusing the server. + t = transport.SvnRaTransport(url=url) + svn.ra.get_log(t.ra, paths, start, end, limit, + discover_changed_paths, + strict_node_history, + receiver) + + def close(self): + pass # Check to see if the given path is a local Subversion repo. Verify this by # looking for several svn-specific files and directories in the given @@ -992,6 +1016,9 @@ relpaths.append(p.strip('/')) args = [self.baseurl, relpaths, start, end, limit, discover_changed_paths, strict_node_history] + # undocumented feature: debugsvnlog can be disabled + if not self.ui.configbool('convert', 'svn.debugsvnlog', True): + return directlogstream(*args) arg = encodeargs(args) hgexe = util.hgexecutable() cmd = '%s debugsvnlog' % util.shellquote(hgexe) diff -r e61a8395c3c1 -r 62153c5d1ce2 tests/test-convert-svn-source.t --- a/tests/test-convert-svn-source.t Fri Feb 07 17:28:37 2014 +0100 +++ b/tests/test-convert-svn-source.t Fri Feb 07 17:29:37 2014 +0100 @@ -198,11 +198,12 @@ extra: convert_revision=svn:........-....-....-....-............/proj B/mytrunk@1 (re) $ cd .. -Test converting empty heads (issue3347) +Test converting empty heads (issue3347). +Also tests getting logs directly without debugsvnlog. $ svnadmin create svn-empty $ svnadmin load -q svn-empty < "$TESTDIR/svn/empty.svndump" - $ hg --config convert.svn.trunk= convert svn-empty + $ hg --config convert.svn.trunk= --config convert.svn.debugsvnlog=0 convert svn-empty assuming destination svn-empty-hg initializing destination svn-empty-hg repository scanning source...