##// END OF EJS Templates
convert/bzr: handle files replaced by directories (issue1623)
Patrick Mezard -
r8126:13b36eb1 default
parent child Browse files
Show More
@@ -0,0 +1,30 b''
1 #!/bin/sh
2
3 "$TESTDIR/hghave" bzr114 || exit 80
4
5 . "$TESTDIR/bzr-definitions"
6
7 # The file/directory replacement can only be reproduced on
8 # bzr >= 1.4. Merge it back in test-convert-bzr-directories once
9 # this version becomes mainstream.
10 echo % replace file with dir
11 mkdir test-replace-file-with-dir
12 cd test-replace-file-with-dir
13 bzr init -q source
14 cd source
15 echo d > d
16 bzr add -q d
17 bzr commit -q -m 'add d file'
18 rm d
19 mkdir d
20 bzr add -q d
21 bzr commit -q -m 'replace with d dir'
22 echo a > d/a
23 bzr add -q d/a
24 bzr commit -q -m 'add d/a'
25 cd ..
26 hg convert source source-hg
27 manifest source-hg tip
28 cd source-hg
29 hg update
30 cd ../..
@@ -0,0 +1,11 b''
1 % replace file with dir
2 initializing destination source-hg repository
3 scanning source...
4 sorting...
5 converting...
6 2 add d file
7 1 replace with d dir
8 0 add d/a
9 % manifest of tip
10 644 d/a
11 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -148,6 +148,11 b' class bzr_source(converter_source):'
148 # bazaar tracks directories, mercurial does not, so
148 # bazaar tracks directories, mercurial does not, so
149 # we have to rename the directory contents
149 # we have to rename the directory contents
150 if kind[1] == 'directory':
150 if kind[1] == 'directory':
151 if kind[0] not in (None, 'directory'):
152 # Replacing 'something' with a directory, record it
153 # so it can be removed.
154 changes.append((self.recode(paths[0]), revid))
155
151 if None not in paths and paths[0] != paths[1]:
156 if None not in paths and paths[0] != paths[1]:
152 # neither an add nor an delete - a move
157 # neither an add nor an delete - a move
153 # rename all directory contents manually
158 # rename all directory contents manually
@@ -31,6 +31,14 b' def has_bzr():'
31 except ImportError:
31 except ImportError:
32 return False
32 return False
33
33
34 def has_bzr114():
35 try:
36 import bzrlib
37 return (bzrlib.__doc__ != None
38 and bzrlib.version_info[:2] == (1, 14))
39 except ImportError:
40 return False
41
34 def has_cvs():
42 def has_cvs():
35 re = r'Concurrent Versions System.*?server'
43 re = r'Concurrent Versions System.*?server'
36 return matchoutput('cvs --version 2>&1', re)
44 return matchoutput('cvs --version 2>&1', re)
@@ -163,6 +171,7 b' def has_outer_repo():'
163 checks = {
171 checks = {
164 "baz": (has_baz, "GNU Arch baz client"),
172 "baz": (has_baz, "GNU Arch baz client"),
165 "bzr": (has_bzr, "Canonical's Bazaar client"),
173 "bzr": (has_bzr, "Canonical's Bazaar client"),
174 "bzr114": (has_bzr114, "Canonical's Bazaar client >= 1.14"),
166 "cvs": (has_cvs, "cvs client/server"),
175 "cvs": (has_cvs, "cvs client/server"),
167 "cvsps": (has_cvsps, "cvsps utility"),
176 "cvsps": (has_cvsps, "cvsps utility"),
168 "darcs": (has_darcs, "darcs client"),
177 "darcs": (has_darcs, "darcs client"),
General Comments 0
You need to be logged in to leave comments. Login now