# HG changeset patch # User Patrick Mezard # Date 2012-02-02 09:15:13 # Node ID 915e06faa8f335397e0298c0630e89b5cfb88604 # Parent f84dda152a550f044082355a504c331029fa9e7f convert/bzr: handle empty bzr repositories (issue3233) diff --git a/hgext/convert/bzr.py b/hgext/convert/bzr.py --- a/hgext/convert/bzr.py +++ b/hgext/convert/bzr.py @@ -107,6 +107,8 @@ class bzr_source(converter_source): 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): diff --git a/tests/test-convert-bzr.t b/tests/test-convert-bzr.t --- a/tests/test-convert-bzr.t +++ b/tests/test-convert-bzr.t @@ -7,6 +7,17 @@ create and rename on the same file in th $ 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 @@ create and rename on the same file in th $ 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...