convert/bzr: handle empty bzr repositories (
issue3233)
--- a/hgext/convert/bzr.py Thu Feb 02 10:15:12 2012 +0100
+++ b/hgext/convert/bzr.py Thu Feb 02 10:15:13 2012 +0100
@@ -107,6 +107,8 @@
if revid is None:
raise util.Abort(_('%s is not a valid revision') % self.rev)
heads = [revid]
+ # Empty repositories return 'null:', which cannot be retrieved
+ heads = [h for h in heads if h != 'null:']
return heads
def getfile(self, name, rev):
--- a/tests/test-convert-bzr.t Thu Feb 02 10:15:12 2012 +0100
+++ b/tests/test-convert-bzr.t Thu Feb 02 10:15:13 2012 +0100
@@ -7,6 +7,17 @@
$ mkdir test-createandrename
$ cd test-createandrename
$ bzr init -q source
+
+test empty repo conversion (issue3233)
+
+ $ hg convert source source-hg
+ initializing destination source-hg repository
+ scanning source...
+ sorting...
+ converting...
+
+back to the rename stuff
+
$ cd source
$ echo a > a
$ echo c > c
@@ -25,7 +36,6 @@
$ bzr commit -q -m 'rename a into b, create a, rename c into d'
$ cd ..
$ hg convert source source-hg
- initializing destination source-hg repository
scanning source...
sorting...
converting...