Merge with crew-stable
authorPatrick Mezard <pmezard@gmail.com>
Sat, 11 Apr 2009 20:49:47 +0200
changeset 8046 f3ef8a352d83
parent 8044 c1e2b7407dc3 (current diff)
parent 8045 e09a2f2ef85d (diff)
child 8047 04c62275cbc7
Merge with crew-stable
hgext/convert/bzr.py
--- a/hgext/convert/bzr.py	Sat Apr 11 00:13:18 2009 +0200
+++ b/hgext/convert/bzr.py	Sat Apr 11 20:49:47 2009 +0200
@@ -21,6 +21,8 @@
 except ImportError:
     pass
 
+supportedkinds = ('file', 'symlink')
+
 class bzr_source(converter_source):
     """Reads Bazaar repositories by using the Bazaar Python libraries"""
 
@@ -71,7 +73,7 @@
     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))
--- a/tests/test-convert-bzr	Sat Apr 11 00:13:18 2009 +0200
+++ b/tests/test-convert-bzr	Sat Apr 11 20:49:47 2009 +0200
@@ -9,12 +9,15 @@
 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
--- a/tests/test-convert-bzr.out	Sat Apr 11 00:13:18 2009 +0200
+++ b/tests/test-convert-bzr.out	Sat Apr 11 20:49:47 2009 +0200
@@ -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