##// END OF EJS Templates
convert/bzr: fix file rename replaced by a dir case (issue1583)...
Patrick Mezard -
r8045:e09a2f2e default
parent child Browse files
Show More
@@ -21,6 +21,8 b' try:'
21 except ImportError:
21 except ImportError:
22 pass
22 pass
23
23
24 supportedkinds = ('file', 'symlink')
25
24 class bzr_source(converter_source):
26 class bzr_source(converter_source):
25 """Reads Bazaar repositories by using the Bazaar Python libraries"""
27 """Reads Bazaar repositories by using the Bazaar Python libraries"""
26
28
@@ -71,7 +73,7 b' class bzr_source(converter_source):'
71 def getfile(self, name, rev):
73 def getfile(self, name, rev):
72 revtree = self.sourcerepo.revision_tree(rev)
74 revtree = self.sourcerepo.revision_tree(rev)
73 fileid = revtree.path2id(name)
75 fileid = revtree.path2id(name)
74 if fileid is None:
76 if fileid is None or revtree.kind(fileid) not in supportedkinds:
75 # the file is not available anymore - was deleted
77 # the file is not available anymore - was deleted
76 raise IOError(_('%s is not available in %s anymore') %
78 raise IOError(_('%s is not available in %s anymore') %
77 (name, rev))
79 (name, rev))
@@ -9,12 +9,15 b' bzr init -q source'
9 cd source
9 cd source
10 echo a > a
10 echo a > a
11 echo c > c
11 echo c > c
12 bzr add -q a c
12 echo e > e
13 bzr commit -q -m 'Initial add: a, c'
13 bzr add -q a c e
14 bzr commit -q -m 'Initial add: a, c, e'
14 bzr mv a b
15 bzr mv a b
15 bzr mv c d
16 bzr mv c d
17 bzr mv e f
16 echo a2 >> a
18 echo a2 >> a
17 bzr add -q a
19 mkdir e
20 bzr add -q a e
18 bzr commit -q -m 'rename a into b, create a, rename c into d'
21 bzr commit -q -m 'rename a into b, create a, rename c into d'
19 cd ..
22 cd ..
20 hg convert source source-hg
23 hg convert source source-hg
@@ -1,27 +1,29 b''
1 % create and rename on the same file in the same step
1 % create and rename on the same file in the same step
2 a => b
2 a => b
3 c => d
3 c => d
4 e => f
4 initializing destination source-hg repository
5 initializing destination source-hg repository
5 scanning source...
6 scanning source...
6 sorting...
7 sorting...
7 converting...
8 converting...
8 1 Initial add: a, c
9 1 Initial add: a, c, e
9 0 rename a into b, create a, rename c into d
10 0 rename a into b, create a, rename c into d
10 o 1 "rename a into b, create a, rename c into d" files: a b c d
11 o 1 "rename a into b, create a, rename c into d" files: a b c d e f
11 |
12 |
12 o 0 "Initial add: a, c" files: a c
13 o 0 "Initial add: a, c, e" files: a c e
13
14
14 % manifest
15 % manifest
15 a
16 a
16 b
17 b
17 d
18 d
19 f
18 % test --rev option
20 % test --rev option
19 initializing destination source-1-hg repository
21 initializing destination source-1-hg repository
20 scanning source...
22 scanning source...
21 sorting...
23 sorting...
22 converting...
24 converting...
23 0 Initial add: a, c
25 0 Initial add: a, c, e
24 o 0 "Initial add: a, c" files: a c
26 o 0 "Initial add: a, c, e" files: a c e
25
27
26 % merge
28 % merge
27 initializing destination source-hg repository
29 initializing destination source-hg repository
General Comments 0
You need to be logged in to leave comments. Login now