# HG changeset patch # User Patrick Mezard # Date 2009-04-11 18:49:47 # Node ID f3ef8a352d83a60a64b9b32c5b8afa22529f268e # Parent c1e2b7407dc3bcbed421989d9f1ba94089f7f0df # Parent e09a2f2ef85d627d1f759633e2c1ac446e68b21e Merge with crew-stable diff --git a/hgext/convert/bzr.py b/hgext/convert/bzr.py --- a/hgext/convert/bzr.py +++ b/hgext/convert/bzr.py @@ -21,6 +21,8 @@ try: except ImportError: pass +supportedkinds = ('file', 'symlink') + class bzr_source(converter_source): """Reads Bazaar repositories by using the Bazaar Python libraries""" @@ -71,7 +73,7 @@ class bzr_source(converter_source): def getfile(self, name, rev): revtree = self.sourcerepo.revision_tree(rev) fileid = revtree.path2id(name) - if fileid is None: + if fileid is None or revtree.kind(fileid) not in supportedkinds: # the file is not available anymore - was deleted raise IOError(_('%s is not available in %s anymore') % (name, rev)) diff --git a/tests/test-convert-bzr b/tests/test-convert-bzr --- a/tests/test-convert-bzr +++ b/tests/test-convert-bzr @@ -9,12 +9,15 @@ bzr init -q source cd source echo a > a echo c > c -bzr add -q a c -bzr commit -q -m 'Initial add: a, c' +echo e > e +bzr add -q a c e +bzr commit -q -m 'Initial add: a, c, e' bzr mv a b bzr mv c d +bzr mv e f echo a2 >> a -bzr add -q a +mkdir e +bzr add -q a e bzr commit -q -m 'rename a into b, create a, rename c into d' cd .. hg convert source source-hg diff --git a/tests/test-convert-bzr.out b/tests/test-convert-bzr.out --- a/tests/test-convert-bzr.out +++ b/tests/test-convert-bzr.out @@ -1,27 +1,29 @@ % create and rename on the same file in the same step a => b c => d +e => f initializing destination source-hg repository scanning source... sorting... converting... -1 Initial add: a, c +1 Initial add: a, c, e 0 rename a into b, create a, rename c into d -o 1 "rename a into b, create a, rename c into d" files: a b c d +o 1 "rename a into b, create a, rename c into d" files: a b c d e f | -o 0 "Initial add: a, c" files: a c +o 0 "Initial add: a, c, e" files: a c e % manifest a b d +f % test --rev option initializing destination source-1-hg repository scanning source... sorting... converting... -0 Initial add: a, c -o 0 "Initial add: a, c" files: a c +0 Initial add: a, c, e +o 0 "Initial add: a, c, e" files: a c e % merge initializing destination source-hg repository