##// END OF EJS Templates
tests: add more tests of copy tracing with removed and re-added files...
Martin von Zweigbergk -
r42793:ab416b5d default
parent child Browse files
Show More
@@ -1,97 +1,387 b''
1 #testcases filelog compatibility changeset
1 #testcases filelog compatibility changeset
2
2
3 $ cat >> $HGRCPATH << EOF
3 $ cat >> $HGRCPATH << EOF
4 > [extensions]
4 > [extensions]
5 > rebase=
5 > rebase=
6 > [alias]
6 > [alias]
7 > l = log -G -T '{rev} {desc}\n{files}\n'
7 > l = log -G -T '{rev} {desc}\n{files}\n'
8 > EOF
8 > EOF
9
9
10 #if compatibility
10 #if compatibility
11 $ cat >> $HGRCPATH << EOF
11 $ cat >> $HGRCPATH << EOF
12 > [experimental]
12 > [experimental]
13 > copies.read-from = compatibility
13 > copies.read-from = compatibility
14 > EOF
14 > EOF
15 #endif
15 #endif
16
16
17 #if changeset
17 #if changeset
18 $ cat >> $HGRCPATH << EOF
18 $ cat >> $HGRCPATH << EOF
19 > [experimental]
19 > [experimental]
20 > copies.read-from = changeset-only
20 > copies.read-from = changeset-only
21 > copies.write-to = changeset-only
21 > copies.write-to = changeset-only
22 > EOF
22 > EOF
23 #endif
23 #endif
24
24
25 $ REPONUM=0
25 $ REPONUM=0
26 $ newrepo() {
26 $ newrepo() {
27 > cd $TESTTMP
27 > cd $TESTTMP
28 > REPONUM=`expr $REPONUM + 1`
28 > REPONUM=`expr $REPONUM + 1`
29 > hg init repo-$REPONUM
29 > hg init repo-$REPONUM
30 > cd repo-$REPONUM
30 > cd repo-$REPONUM
31 > }
31 > }
32
32
33 Copy a file, then delete destination, then copy again. This does not create a new filelog entry.
33 Copy a file, then delete destination, then copy again. This does not create a new filelog entry.
34 $ newrepo
34 $ newrepo
35 $ echo x > x
35 $ echo x > x
36 $ hg ci -Aqm 'add x'
36 $ hg ci -Aqm 'add x'
37 $ echo x2 > x
38 $ hg ci -m 'modify x'
39 $ hg co -q 0
37 $ hg cp x y
40 $ hg cp x y
38 $ hg ci -m 'copy x to y'
41 $ hg ci -qm 'copy x to y'
39 $ hg rm y
42 $ hg rm y
40 $ hg ci -m 'remove y'
43 $ hg ci -m 'remove y'
41 $ hg cp -f x y
44 $ hg cp -f x y
42 $ hg ci -m 'copy x onto y (again)'
45 $ hg ci -m 'copy x onto y (again)'
43 $ hg l
46 $ hg l
44 @ 3 copy x onto y (again)
47 @ 4 copy x onto y (again)
48 | y
49 o 3 remove y
45 | y
50 | y
46 o 2 remove y
51 o 2 copy x to y
47 | y
52 | y
48 o 1 copy x to y
53 | o 1 modify x
49 | y
54 |/ x
50 o 0 add x
55 o 0 add x
51 x
56 x
52 $ hg debugp1copies -r 3
57 $ hg debugp1copies -r 4
53 x -> y
58 x -> y
54 $ hg debugpathcopies 0 3
59 $ hg debugpathcopies 0 4
55 x -> y
60 x -> y
61 $ hg graft -r 1
62 grafting 1:* "modify x" (glob)
63 merging y and x to y
64 $ hg co -qC 1
65 $ hg graft -r 4
66 grafting 4:* "copy x onto y (again)" (glob)
67 merging x and y to y
56
68
57 Copy x to y, then remove y, then add back y. With copy metadata in the changeset, this could easily
69 Copy x to y, then remove y, then add back y. With copy metadata in the
58 end up reporting y as copied from x (if we don't unmark it as a copy when it's removed).
70 changeset, this could easily end up reporting y as copied from x (if we don't
71 unmark it as a copy when it's removed). Despite x and y not being related, we
72 want grafts to propagate across the rename.
59 $ newrepo
73 $ newrepo
60 $ echo x > x
74 $ echo x > x
61 $ hg ci -Aqm 'add x'
75 $ hg ci -Aqm 'add x'
76 $ echo x2 > x
77 $ hg ci -m 'modify x'
78 $ hg co -q 0
62 $ hg mv x y
79 $ hg mv x y
63 $ hg ci -m 'rename x to y'
80 $ hg ci -qm 'rename x to y'
64 $ hg rm y
81 $ hg rm y
65 $ hg ci -qm 'remove y'
82 $ hg ci -qm 'remove y'
66 $ echo x > y
83 $ echo x > y
67 $ hg ci -Aqm 'add back y'
84 $ hg ci -Aqm 'add back y'
68 $ hg l
85 $ hg l
69 @ 3 add back y
86 @ 4 add back y
87 | y
88 o 3 remove y
70 | y
89 | y
71 o 2 remove y
90 o 2 rename x to y
72 | y
91 | x y
73 o 1 rename x to y
92 | o 1 modify x
93 |/ x
94 o 0 add x
95 x
96 $ hg debugpathcopies 0 4
97 BROKEN: This should succeed and merge the changes from x into y
98 $ hg graft -r 1
99 grafting 1:* "modify x" (glob)
100 file 'x' was deleted in local [local] but was modified in other [graft].
101 You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
102 What do you want to do? u
103 abort: unresolved conflicts, can't continue
104 (use 'hg resolve' and 'hg graft --continue')
105 [255]
106
107 Add x, remove it, then add it back, then rename x to y. Similar to the case
108 above, but here the break in history is before the rename.
109 $ newrepo
110 $ echo x > x
111 $ hg ci -Aqm 'add x'
112 $ echo x2 > x
113 $ hg ci -m 'modify x'
114 $ hg co -q 0
115 $ hg rm x
116 $ hg ci -qm 'remove x'
117 $ echo x > x
118 $ hg ci -Aqm 'add x again'
119 $ hg mv x y
120 $ hg ci -m 'rename x to y'
121 $ hg l
122 @ 4 rename x to y
74 | x y
123 | x y
124 o 3 add x again
125 | x
126 o 2 remove x
127 | x
128 | o 1 modify x
129 |/ x
130 o 0 add x
131 x
132 $ hg debugpathcopies 0 4
133 x -> y
134 $ hg graft -r 1
135 grafting 1:* "modify x" (glob)
136 merging y and x to y
137 $ hg co -qC 1
138 $ hg graft -r 4
139 grafting 4:* "rename x to y" (glob)
140 merging x and y to y
141
142 Add x, modify it, remove it, then add it back, then rename x to y. Similar to
143 the case above, but here the re-added file's nodeid is different from before
144 the break.
145
146 $ newrepo
147 $ echo x > x
148 $ hg ci -Aqm 'add x'
149 $ echo x2 > x
150 $ hg ci -m 'modify x'
151 $ echo x3 > x
152 $ hg ci -qm 'modify x again'
153 $ hg co -q 1
154 $ hg rm x
155 $ hg ci -qm 'remove x'
156 # Same content to avoid conflicts
157 $ hg revert -r 1 x
158 $ hg ci -Aqm 'add x again'
159 $ hg mv x y
160 $ hg ci -m 'rename x to y'
161 $ hg l
162 @ 5 rename x to y
163 | x y
164 o 4 add x again
165 | x
166 o 3 remove x
167 | x
168 | o 2 modify x again
169 |/ x
170 o 1 modify x
171 | x
75 o 0 add x
172 o 0 add x
76 x
173 x
77 $ hg debugp1copies -r 3
174 $ hg debugpathcopies 0 5
78 $ hg debugpathcopies 0 3
175 x -> y (no-filelog !)
176 #if no-filelog
177 $ hg graft -r 2
178 grafting 2:* "modify x again" (glob)
179 merging y and x to y
180 #else
181 BROKEN: This should succeed and merge the changes from x into y
182 $ hg graft -r 2
183 grafting 2:* "modify x again" (glob)
184 file 'x' was deleted in local [local] but was modified in other [graft].
185 You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
186 What do you want to do? u
187 abort: unresolved conflicts, can't continue
188 (use 'hg resolve' and 'hg graft --continue')
189 [255]
190 #endif
191 $ hg co -qC 2
192 BROKEN: This should succeed and merge the changes from x into y
193 $ hg graft -r 5
194 grafting 5:* "rename x to y"* (glob)
195 file 'x' was deleted in other [graft] but was modified in local [local].
196 You can use (c)hanged version, (d)elete, or leave (u)nresolved.
197 What do you want to do? u
198 abort: unresolved conflicts, can't continue
199 (use 'hg resolve' and 'hg graft --continue')
200 [255]
201
202 Add x, remove it, then add it back, rename x to y from the first commit.
203 Similar to the case above, but here the break in history is parallel to the
204 rename.
205 $ newrepo
206 $ echo x > x
207 $ hg ci -Aqm 'add x'
208 $ hg rm x
209 $ hg ci -qm 'remove x'
210 $ echo x > x
211 $ hg ci -Aqm 'add x again'
212 $ echo x2 > x
213 $ hg ci -m 'modify x'
214 $ hg co -q 0
215 $ hg mv x y
216 $ hg ci -qm 'rename x to y'
217 $ hg l
218 @ 4 rename x to y
219 | x y
220 | o 3 modify x
221 | | x
222 | o 2 add x again
223 | | x
224 | o 1 remove x
225 |/ x
226 o 0 add x
227 x
228 $ hg debugpathcopies 2 4
229 x -> y
230 $ hg graft -r 3
231 grafting 3:* "modify x" (glob)
232 merging y and x to y
233 $ hg co -qC 3
234 $ hg graft -r 4
235 grafting 4:* "rename x to y" (glob)
236 merging x and y to y
237
238 Add x, remove it, then add it back, rename x to y from the first commit.
239 Similar to the case above, but here the re-added file's nodeid is different
240 from the base.
241 $ newrepo
242 $ echo x > x
243 $ hg ci -Aqm 'add x'
244 $ hg rm x
245 $ hg ci -qm 'remove x'
246 $ echo x2 > x
247 $ hg ci -Aqm 'add x again with different content'
248 $ hg co -q 0
249 $ hg mv x y
250 $ hg ci -qm 'rename x to y'
251 $ hg l
252 @ 3 rename x to y
253 | x y
254 | o 2 add x again with different content
255 | | x
256 | o 1 remove x
257 |/ x
258 o 0 add x
259 x
260 $ hg debugpathcopies 2 3
261 x -> y
262 BROKEN: This should merge the changes from x into y
263 $ hg graft -r 2
264 grafting 2:* "add x again with different content" (glob)
265 $ hg co -qC 2
266 BROKEN: This should succeed and merge the changes from x into y
267 $ hg graft -r 3
268 grafting 3:* "rename x to y" (glob)
269 file 'x' was deleted in other [graft] but was modified in local [local].
270 You can use (c)hanged version, (d)elete, or leave (u)nresolved.
271 What do you want to do? u
272 abort: unresolved conflicts, can't continue
273 (use 'hg resolve' and 'hg graft --continue')
274 [255]
275
276 Add x on two branches, then rename x to y on one side. Similar to the case
277 above, but here the break in history is via the base commit.
278 $ newrepo
279 $ echo a > a
280 $ hg ci -Aqm 'base'
281 $ echo x > x
282 $ hg ci -Aqm 'add x'
283 $ echo x2 > x
284 $ hg ci -m 'modify x'
285 $ hg co -q 0
286 $ echo x > x
287 $ hg ci -Aqm 'add x again'
288 $ hg mv x y
289 $ hg ci -qm 'rename x to y'
290 $ hg l
291 @ 4 rename x to y
292 | x y
293 o 3 add x again
294 | x
295 | o 2 modify x
296 | | x
297 | o 1 add x
298 |/ x
299 o 0 base
300 a
301 $ hg debugpathcopies 1 4
302 BROKEN: This should succeed and merge the changes from x into y
303 $ hg graft -r 2
304 grafting 2:* "modify x" (glob)
305 file 'x' was deleted in local [local] but was modified in other [graft].
306 What do you want to do?
307 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
308 abort: unresolved conflicts, can't continue
309 (use 'hg resolve' and 'hg graft --continue')
310 [255]
311 $ hg co -qC 2
312 $ hg graft -r 4
313 grafting 4:* "rename x to y"* (glob)
314 merging x and y to y
315
316 Add x on two branches, with same content but different history, then rename x
317 to y on one side. Similar to the case above, here the file's nodeid is
318 different between the branches.
319 $ newrepo
320 $ echo a > a
321 $ hg ci -Aqm 'base'
322 $ echo x > x
323 $ hg ci -Aqm 'add x'
324 $ echo x2 > x
325 $ hg ci -m 'modify x'
326 $ hg co -q 0
327 $ touch x
328 $ hg ci -Aqm 'add empty x'
329 # Same content to avoid conflicts
330 $ hg revert -r 1 x
331 $ hg ci -m 'modify x to match commit 1'
332 $ hg mv x y
333 $ hg ci -qm 'rename x to y'
334 $ hg l
335 @ 5 rename x to y
336 | x y
337 o 4 modify x to match commit 1
338 | x
339 o 3 add empty x
340 | x
341 | o 2 modify x
342 | | x
343 | o 1 add x
344 |/ x
345 o 0 base
346 a
347 $ hg debugpathcopies 1 5
348 BROKEN: This should succeed and merge the changes from x into y
349 $ hg graft -r 2
350 grafting 2:* "modify x" (glob)
351 file 'x' was deleted in local [local] but was modified in other [graft].
352 You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
353 What do you want to do? u
354 abort: unresolved conflicts, can't continue
355 (use 'hg resolve' and 'hg graft --continue')
356 [255]
357 $ hg co -qC 2
358 BROKEN: This should succeed and merge the changes from x into y
359 $ hg graft -r 5
360 grafting 5:* "rename x to y"* (glob)
361 file 'x' was deleted in other [graft] but was modified in local [local].
362 You can use (c)hanged version, (d)elete, or leave (u)nresolved.
363 What do you want to do? u
364 abort: unresolved conflicts, can't continue
365 (use 'hg resolve' and 'hg graft --continue')
366 [255]
79
367
80 Copies via null revision (there shouldn't be any)
368 Copies via null revision (there shouldn't be any)
81 $ newrepo
369 $ newrepo
82 $ echo x > x
370 $ echo x > x
83 $ hg ci -Aqm 'add x'
371 $ hg ci -Aqm 'add x'
84 $ hg cp x y
372 $ hg cp x y
85 $ hg ci -m 'copy x to y'
373 $ hg ci -m 'copy x to y'
86 $ hg co -q null
374 $ hg co -q null
87 $ echo x > x
375 $ echo x > x
88 $ hg ci -Aqm 'add x (again)'
376 $ hg ci -Aqm 'add x (again)'
89 $ hg l
377 $ hg l
90 @ 2 add x (again)
378 @ 2 add x (again)
91 x
379 x
92 o 1 copy x to y
380 o 1 copy x to y
93 | y
381 | y
94 o 0 add x
382 o 0 add x
95 x
383 x
96 $ hg debugpathcopies 1 2
384 $ hg debugpathcopies 1 2
97 $ hg debugpathcopies 2 1
385 $ hg debugpathcopies 2 1
386 $ hg graft -r 1
387 grafting 1:* "copy x to y" (glob)
@@ -1,235 +1,186 b''
1 $ hg init
1 $ hg init
2
2
3 $ echo "[merge]" >> .hg/hgrc
3 $ echo "[merge]" >> .hg/hgrc
4 $ echo "followcopies = 1" >> .hg/hgrc
4 $ echo "followcopies = 1" >> .hg/hgrc
5
5
6 $ echo foo > a
6 $ echo foo > a
7 $ echo foo > a2
7 $ echo foo > a2
8 $ hg add a a2
8 $ hg add a a2
9 $ hg ci -m "start"
9 $ hg ci -m "start"
10
10
11 $ hg mv a b
11 $ hg mv a b
12 $ hg mv a2 b2
12 $ hg mv a2 b2
13 $ hg ci -m "rename"
13 $ hg ci -m "rename"
14
14
15 $ hg co 0
15 $ hg co 0
16 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
16 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
17
17
18 $ echo blahblah > a
18 $ echo blahblah > a
19 $ echo blahblah > a2
19 $ echo blahblah > a2
20 $ hg mv a2 c2
20 $ hg mv a2 c2
21 $ hg ci -m "modify"
21 $ hg ci -m "modify"
22 created new head
22 created new head
23
23
24 $ hg merge -y --debug
24 $ hg merge -y --debug
25 unmatched files in local:
25 unmatched files in local:
26 c2
26 c2
27 unmatched files in other:
27 unmatched files in other:
28 b
28 b
29 b2
29 b2
30 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
30 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
31 src: 'a' -> dst: 'b' *
31 src: 'a' -> dst: 'b' *
32 src: 'a2' -> dst: 'b2' !
32 src: 'a2' -> dst: 'b2' !
33 src: 'a2' -> dst: 'c2' !
33 src: 'a2' -> dst: 'c2' !
34 checking for directory renames
34 checking for directory renames
35 resolving manifests
35 resolving manifests
36 branchmerge: True, force: False, partial: False
36 branchmerge: True, force: False, partial: False
37 ancestor: af1939970a1c, local: 044f8520aeeb+, remote: 85c198ef2f6c
37 ancestor: af1939970a1c, local: 044f8520aeeb+, remote: 85c198ef2f6c
38 note: possible conflict - a2 was renamed multiple times to:
38 note: possible conflict - a2 was renamed multiple times to:
39 b2
39 b2
40 c2
40 c2
41 preserving a for resolve of b
41 preserving a for resolve of b
42 removing a
42 removing a
43 b2: remote created -> g
43 b2: remote created -> g
44 getting b2
44 getting b2
45 b: remote moved from a -> m (premerge)
45 b: remote moved from a -> m (premerge)
46 picked tool ':merge' for b (binary False symlink False changedelete False)
46 picked tool ':merge' for b (binary False symlink False changedelete False)
47 merging a and b to b
47 merging a and b to b
48 my b@044f8520aeeb+ other b@85c198ef2f6c ancestor a@af1939970a1c
48 my b@044f8520aeeb+ other b@85c198ef2f6c ancestor a@af1939970a1c
49 premerge successful
49 premerge successful
50 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
50 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
51 (branch merge, don't forget to commit)
51 (branch merge, don't forget to commit)
52
52
53 $ hg status -AC
53 $ hg status -AC
54 M b
54 M b
55 a
55 a
56 M b2
56 M b2
57 R a
57 R a
58 C c2
58 C c2
59
59
60 $ cat b
60 $ cat b
61 blahblah
61 blahblah
62
62
63 $ hg ci -m "merge"
63 $ hg ci -m "merge"
64
64
65 $ hg debugindex b
65 $ hg debugindex b
66 rev linkrev nodeid p1 p2
66 rev linkrev nodeid p1 p2
67 0 1 57eacc201a7f 000000000000 000000000000
67 0 1 57eacc201a7f 000000000000 000000000000
68 1 3 4727ba907962 000000000000 57eacc201a7f
68 1 3 4727ba907962 000000000000 57eacc201a7f
69
69
70 $ hg debugrename b
70 $ hg debugrename b
71 b renamed from a:dd03b83622e78778b403775d0d074b9ac7387a66
71 b renamed from a:dd03b83622e78778b403775d0d074b9ac7387a66
72
72
73 This used to trigger a "divergent renames" warning, despite no renames
73 This used to trigger a "divergent renames" warning, despite no renames
74
74
75 $ hg cp b b3
75 $ hg cp b b3
76 $ hg cp b b4
76 $ hg cp b b4
77 $ hg ci -A -m 'copy b twice'
77 $ hg ci -A -m 'copy b twice'
78 $ hg up '.^'
78 $ hg up '.^'
79 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
79 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
80 $ hg up
80 $ hg up
81 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
81 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
82 $ hg rm b3 b4
82 $ hg rm b3 b4
83 $ hg ci -m 'clean up a bit of our mess'
83 $ hg ci -m 'clean up a bit of our mess'
84
84
85 We'd rather not warn on divergent renames done in the same changeset (issue2113)
85 We'd rather not warn on divergent renames done in the same changeset (issue2113)
86
86
87 $ hg cp b b3
87 $ hg cp b b3
88 $ hg mv b b4
88 $ hg mv b b4
89 $ hg ci -A -m 'divergent renames in same changeset'
89 $ hg ci -A -m 'divergent renames in same changeset'
90 $ hg up '.^'
90 $ hg up '.^'
91 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
91 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
92 $ hg up
92 $ hg up
93 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
93 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
94
94
95 Check for issue2642
95 Check for issue2642
96
96
97 $ hg init t
97 $ hg init t
98 $ cd t
98 $ cd t
99
99
100 $ echo c0 > f1
100 $ echo c0 > f1
101 $ hg ci -Aqm0
101 $ hg ci -Aqm0
102
102
103 $ hg up null -q
103 $ hg up null -q
104 $ echo c1 > f1 # backport
104 $ echo c1 > f1 # backport
105 $ hg ci -Aqm1
105 $ hg ci -Aqm1
106 $ hg mv f1 f2
106 $ hg mv f1 f2
107 $ hg ci -qm2
107 $ hg ci -qm2
108
108
109 $ hg up 0 -q
109 $ hg up 0 -q
110 $ hg merge 1 -q --tool internal:local
110 $ hg merge 1 -q --tool internal:local
111 $ hg ci -qm3
111 $ hg ci -qm3
112
112
113 $ hg merge 2
113 $ hg merge 2
114 merging f1 and f2 to f2
114 merging f1 and f2 to f2
115 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
115 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
116 (branch merge, don't forget to commit)
116 (branch merge, don't forget to commit)
117
117
118 $ cat f2
118 $ cat f2
119 c0
119 c0
120
120
121 $ cd ..
121 $ cd ..
122
122
123 Check for issue2089
123 Check for issue2089
124
124
125 $ hg init repo2089
125 $ hg init repo2089
126 $ cd repo2089
126 $ cd repo2089
127
127
128 $ echo c0 > f1
128 $ echo c0 > f1
129 $ hg ci -Aqm0
129 $ hg ci -Aqm0
130
130
131 $ hg up null -q
131 $ hg up null -q
132 $ echo c1 > f1
132 $ echo c1 > f1
133 $ hg ci -Aqm1
133 $ hg ci -Aqm1
134
134
135 $ hg up 0 -q
135 $ hg up 0 -q
136 $ hg merge 1 -q --tool internal:local
136 $ hg merge 1 -q --tool internal:local
137 $ echo c2 > f1
137 $ echo c2 > f1
138 $ hg ci -qm2
138 $ hg ci -qm2
139
139
140 $ hg up 1 -q
140 $ hg up 1 -q
141 $ hg mv f1 f2
141 $ hg mv f1 f2
142 $ hg ci -Aqm3
142 $ hg ci -Aqm3
143
143
144 $ hg up 2 -q
144 $ hg up 2 -q
145 $ hg merge 3
145 $ hg merge 3
146 merging f1 and f2 to f2
146 merging f1 and f2 to f2
147 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
147 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
148 (branch merge, don't forget to commit)
148 (branch merge, don't forget to commit)
149
149
150 $ cat f2
150 $ cat f2
151 c2
151 c2
152
152
153 $ cd ..
153 $ cd ..
154
154
155 Check for issue3074
155 Check for issue3074
156
156
157 $ hg init repo3074
157 $ hg init repo3074
158 $ cd repo3074
158 $ cd repo3074
159 $ echo foo > file
159 $ echo foo > file
160 $ hg add file
160 $ hg add file
161 $ hg commit -m "added file"
161 $ hg commit -m "added file"
162 $ hg mv file newfile
162 $ hg mv file newfile
163 $ hg commit -m "renamed file"
163 $ hg commit -m "renamed file"
164 $ hg update 0
164 $ hg update 0
165 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
165 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
166 $ hg rm file
166 $ hg rm file
167 $ hg commit -m "deleted file"
167 $ hg commit -m "deleted file"
168 created new head
168 created new head
169 $ hg merge --debug
169 $ hg merge --debug
170 unmatched files in other:
170 unmatched files in other:
171 newfile
171 newfile
172 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
172 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
173 src: 'file' -> dst: 'newfile' %
173 src: 'file' -> dst: 'newfile' %
174 checking for directory renames
174 checking for directory renames
175 resolving manifests
175 resolving manifests
176 branchmerge: True, force: False, partial: False
176 branchmerge: True, force: False, partial: False
177 ancestor: 19d7f95df299, local: 0084274f6b67+, remote: 5d32493049f0
177 ancestor: 19d7f95df299, local: 0084274f6b67+, remote: 5d32493049f0
178 note: possible conflict - file was deleted and renamed to:
178 note: possible conflict - file was deleted and renamed to:
179 newfile
179 newfile
180 newfile: remote created -> g
180 newfile: remote created -> g
181 getting newfile
181 getting newfile
182 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
182 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
183 (branch merge, don't forget to commit)
183 (branch merge, don't forget to commit)
184 $ hg status
184 $ hg status
185 M newfile
185 M newfile
186 $ cd ..
186 $ cd ..
187
188 Check that file is considered unrelated when deleted and recreated
189
190 $ hg init unrelated
191 $ cd unrelated
192 $ echo foo > file
193 $ hg add file
194 $ hg commit -m "added file"
195 $ hg cp file newfile
196 $ hg commit -m "copy file"
197 $ hg update 0
198 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
199 $ hg rm file
200 $ hg commit -m "deleted file"
201 created new head
202 $ echo bar > file
203 $ hg add file
204 $ hg ci -m 'recreate file'
205 $ hg log -G -T '{rev} {desc}\n'
206 @ 3 recreate file
207 |
208 o 2 deleted file
209 |
210 | o 1 copy file
211 |/
212 o 0 added file
213
214 BROKEN: this is inconsistent with `hg merge` (below), which doesn't consider
215 'file' renamed same since it was deleted for a while
216 $ hg st --copies --rev 3 --rev 1
217 M file
218 A newfile
219 file
220 $ hg merge --debug 1
221 unmatched files in other:
222 newfile
223 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
224 src: 'file' -> dst: 'newfile'
225 checking for directory renames
226 resolving manifests
227 branchmerge: True, force: False, partial: False
228 ancestor: 19d7f95df299, local: 4e4a42b1cbdf+, remote: 45b14aae7432
229 newfile: remote created -> g
230 getting newfile
231 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
232 (branch merge, don't forget to commit)
233 $ hg status
234 M newfile
235 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now