diff tests/test-convert-svn-source.t @ 16466:c53a49c345e1 stable

convert/svn: do not try converting empty head revisions (issue3347) Subversion conversion works by picking trunk and branches heads, computing a revision graph from them and converting the selected commits. By design we fail to convert empty revisions so we have to be careful when discovering the revision graph. In this particular issue, the source svn repository was a partial mirror made by svnsync. The funny part is svnsync preserves all revisions including empty ones. Also, we trusted ra.stat(path, stop).created_rev to give us the latest revision with changes in path history up to stop. This assumption broke at least when path is '', that is the repository root, which always returned 'stop' revision despited being empty. The workaround is to first trust ra.stat() but if the returned revision appear empty, search the whole path history from stop to r1 until some changes are found.
author Patrick Mezard <patrick@mezard.eu>
date Wed, 18 Apr 2012 14:04:58 +0200
parents 00121103546a
children b12b65d2cbe4
line wrap: on
line diff
--- a/tests/test-convert-svn-source.t	Wed Apr 18 14:04:58 2012 +0200
+++ b/tests/test-convert-svn-source.t	Wed Apr 18 14:04:58 2012 +0200
@@ -187,3 +187,24 @@
   extra:       branch=default
   extra:       convert_revision=svn:........-....-....-....-............/proj B/mytrunk@1 (re)
   $ cd ..
+
+Test converting empty heads (issue3347)
+
+  $ svnadmin create svn-empty
+  $ svnadmin load -q svn-empty < "$TESTDIR/svn/empty.svndump"
+  $ hg --config convert.svn.trunk= convert svn-empty
+  assuming destination svn-empty-hg
+  initializing destination svn-empty-hg repository
+  scanning source...
+  sorting...
+  converting...
+  1 init projA
+  0 adddir
+  $ hg --config convert.svn.trunk= convert file://$svnpath/svn-empty/trunk
+  assuming destination trunk-hg
+  initializing destination trunk-hg repository
+  scanning source...
+  sorting...
+  converting...
+  1 init projA
+  0 adddir