##// END OF EJS Templates
convert/gnuarch: fix switched copy source and destination...
Patrick Mezard -
r7567:0946294d default
parent child Browse files
Show More
@@ -121,17 +121,16 b' class gnuarch_source(converter_source, c'
121 to = self.changes[rev].ren_files[src]
121 to = self.changes[rev].ren_files[src]
122 changes.append((src, rev))
122 changes.append((src, rev))
123 changes.append((to, rev))
123 changes.append((to, rev))
124 copies[src] = to
124 copies[to] = src
125
125
126 for src in self.changes[rev].ren_dirs:
126 for src in self.changes[rev].ren_dirs:
127 to = self.changes[rev].ren_dirs[src]
127 to = self.changes[rev].ren_dirs[src]
128 chgs, cps = self._rendirchanges(src, to);
128 chgs, cps = self._rendirchanges(src, to);
129 changes += [(f, rev) for f in chgs]
129 changes += [(f, rev) for f in chgs]
130 for c in cps:
130 copies.update(cps)
131 copies[c] = cps[c]
132
131
133 self.lastrev = rev
132 self.lastrev = rev
134 return util.sort(changes), copies
133 return util.sort(util.unique(changes)), copies
135
134
136 def getcommit(self, rev):
135 def getcommit(self, rev):
137 changes = self.changes[rev]
136 changes = self.changes[rev]
@@ -213,7 +212,7 b' class gnuarch_source(converter_source, c'
213 d = os.path.join(dest, f)
212 d = os.path.join(dest, f)
214 changes.append(s)
213 changes.append(s)
215 changes.append(d)
214 changes.append(d)
216 copies[s] = d
215 copies[d] = s
217 return changes, copies
216 return changes, copies
218
217
219 def _obtainrevision(self, rev):
218 def _obtainrevision(self, rev):
@@ -55,6 +55,14 b' baz mv src/a-link-2 c'
55 baz mv src test
55 baz mv src test
56 baz commit -s "move and rename a-link-2 file and src directory"
56 baz commit -s "move and rename a-link-2 file and src directory"
57
57
58 echo % move and add the moved file again
59 echo e > e
60 baz add e
61 baz commit -s "add e"
62 baz mv e f
63 echo ee > e
64 baz add e
65 baz commit -s "move e and recreate it again"
58 cd ..
66 cd ..
59
67
60 echo % converting baz repo to Mercurial
68 echo % converting baz repo to Mercurial
@@ -71,3 +79,4 b' echo % show graph log'
71 glog -R baz-repo-hg
79 glog -R baz-repo-hg
72 hg up -q -R baz-repo-hg
80 hg up -q -R baz-repo-hg
73 hg -R baz-repo-hg manifest --debug
81 hg -R baz-repo-hg manifest --debug
82 hg -R baz-repo-hg log -r 5 -r 7 -C --debug | grep copies
@@ -44,19 +44,36 b' A/ test/.arch-ids'
44 => src/.arch-ids/b.id test/.arch-ids/b.id
44 => src/.arch-ids/b.id test/.arch-ids/b.id
45 * update pristine tree (baz@mercurial--convert/baz--test--0--patch-4 => baz--test--0--patch-5)
45 * update pristine tree (baz@mercurial--convert/baz--test--0--patch-4 => baz--test--0--patch-5)
46 * committed baz@mercurial--convert/baz--test--0--patch-5
46 * committed baz@mercurial--convert/baz--test--0--patch-5
47 % move and add the moved file again
48 A .arch-ids/e.id
49 A e
50 * update pristine tree (baz@mercurial--convert/baz--test--0--patch-5 => baz--test--0--patch-6)
51 * committed baz@mercurial--convert/baz--test--0--patch-6
52 A .arch-ids/e.id
53 A e
54 => .arch-ids/e.id .arch-ids/f.id
55 => e f
56 * update pristine tree (baz@mercurial--convert/baz--test--0--patch-6 => baz--test--0--patch-7)
57 * committed baz@mercurial--convert/baz--test--0--patch-7
47 % converting baz repo to Mercurial
58 % converting baz repo to Mercurial
48 initializing destination baz-repo-hg repository
59 initializing destination baz-repo-hg repository
49 analyzing tree version baz@mercurial--convert/baz--test--0...
60 analyzing tree version baz@mercurial--convert/baz--test--0...
50 scanning source...
61 scanning source...
51 sorting...
62 sorting...
52 converting...
63 converting...
53 5 initial import
64 7 initial import
54 4 added a file, src and src/b (binary)
65 6 added a file, src and src/b (binary)
55 3 added link to a and modify a
66 5 added link to a and modify a
56 2 added second link and modify b
67 4 added second link and modify b
57 1 file to link and link to file test
68 3 file to link and link to file test
58 0 move and rename a-link-2 file and src directory
69 2 move and rename a-link-2 file and src directory
70 1 add e
71 0 move e and recreate it again
59 % show graph log
72 % show graph log
73 o 7 "move e and recreate it again" files: e f
74 |
75 o 6 "add e" files: e
76 |
60 o 5 "move and rename a-link-2 file and src directory" files: c src/a-link src/a-link-2 src/b test/a-link test/b
77 o 5 "move and rename a-link-2 file and src directory" files: c src/a-link src/a-link-2 src/b test/a-link test/b
61 |
78 |
62 o 4 "file to link and link to file test" files: src/a-link-2 src/b
79 o 4 "file to link and link to file test" files: src/a-link-2 src/b
@@ -70,6 +87,10 b' o 1 "added a file, src and src/b (binar'
70 o 0 "initial import" files:
87 o 0 "initial import" files:
71
88
72 c4072c4b72e1cabace081888efa148ee80ca3cbb 644 a
89 c4072c4b72e1cabace081888efa148ee80ca3cbb 644 a
73 e3207be798aaf87a444a62903621edab4ddc1fb6 644 c
90 623942606de842342ac7b221ae9ccabc13b5d8c8 644 c
74 1f6b5bb93f1da278ef1fead1e4740a03d8802e9f 644 @ test/a-link
91 1a4a864db0073705a11b1439f563bfa4b46d9246 644 e
75 1f6b5bb93f1da278ef1fead1e4740a03d8802e9f 644 @ test/b
92 ab9089704d7c988687521e6adf018ebf767da7d6 644 f
93 43b4308708a4b36340566684df2e2a074b12ceb0 644 @ test/a-link
94 73773e3389ef7ec5a070519b74895d2eaa4ad5db 644 @ test/b
95 copies: c (src/a-link-2) test/a-link (src/a-link) test/b (src/b)
96 copies: f (e)
@@ -67,6 +67,6 b' o 1 "added a file, src and src/b (binar'
67 o 0 "initial import" files:
67 o 0 "initial import" files:
68
68
69 c4072c4b72e1cabace081888efa148ee80ca3cbb 644 a
69 c4072c4b72e1cabace081888efa148ee80ca3cbb 644 a
70 e3207be798aaf87a444a62903621edab4ddc1fb6 644 c
70 623942606de842342ac7b221ae9ccabc13b5d8c8 644 c
71 1f6b5bb93f1da278ef1fead1e4740a03d8802e9f 644 @ test/a-link
71 43b4308708a4b36340566684df2e2a074b12ceb0 644 @ test/a-link
72 1f6b5bb93f1da278ef1fead1e4740a03d8802e9f 644 @ test/b
72 73773e3389ef7ec5a070519b74895d2eaa4ad5db 644 @ test/b
General Comments 0
You need to be logged in to leave comments. Login now