Show More
@@ -151,7 +151,7 b' def findcopies(repo, m1, m2, limit):' | |||||
151 | ''' check if an apparent pair actually matches ''' |
|
151 | ''' check if an apparent pair actually matches ''' | |
152 | c2 = ctx(f2, man[f2]) |
|
152 | c2 = ctx(f2, man[f2]) | |
153 | ca = c.ancestor(c2) |
|
153 | ca = c.ancestor(c2) | |
154 | if ca: |
|
154 | if ca and ca.path() == c.path() or ca.path() == c2.path(): | |
155 | copy[c.path()] = f2 |
|
155 | copy[c.path()] = f2 | |
156 | copy[f2] = c.path() |
|
156 | copy[f2] = c.path() | |
157 |
|
157 | |||
@@ -284,8 +284,8 b' def applyupdates(repo, action, xp1, xp2)' | |||||
284 | (f, inst.strerror)) |
|
284 | (f, inst.strerror)) | |
285 | removed +=1 |
|
285 | removed +=1 | |
286 | elif m == "c": # copy |
|
286 | elif m == "c": # copy | |
287 |
f2, fd, my, other, flag, |
|
287 | f2, fd, my, other, flag, move = a[2:] | |
288 |
if filemerge(repo, f, f2, fd, my, other, xp1, xp2, |
|
288 | if filemerge(repo, f, f2, fd, my, other, xp1, xp2, move): | |
289 | unresolved += 1 |
|
289 | unresolved += 1 | |
290 | util.set_exec(repo.wjoin(fd), flag) |
|
290 | util.set_exec(repo.wjoin(fd), flag) | |
291 | merged += 1 |
|
291 | merged += 1 | |
@@ -339,6 +339,25 b' def recordupdates(repo, action, branchme' | |||||
339 | fl = repo.file(f) |
|
339 | fl = repo.file(f) | |
340 | f_len = fl.size(fl.rev(other)) |
|
340 | f_len = fl.size(fl.rev(other)) | |
341 | repo.dirstate.update([f], 'n', st_size=f_len, st_mtime=-1) |
|
341 | repo.dirstate.update([f], 'n', st_size=f_len, st_mtime=-1) | |
|
342 | elif m == "c": # copy | |||
|
343 | f2, fd, my, other, flag, move = a[2:] | |||
|
344 | if branchmerge: | |||
|
345 | # We've done a branch merge, mark this file as merged | |||
|
346 | # so that we properly record the merger later | |||
|
347 | repo.dirstate.update([fd], 'm') | |||
|
348 | else: | |||
|
349 | # We've update-merged a locally modified file, so | |||
|
350 | # we set the dirstate to emulate a normal checkout | |||
|
351 | # of that file some time in the past. Thus our | |||
|
352 | # merge will appear as a normal local file | |||
|
353 | # modification. | |||
|
354 | fl = repo.file(f) | |||
|
355 | f_len = fl.size(fl.rev(other)) | |||
|
356 | repo.dirstate.update([fd], 'n', st_size=f_len, st_mtime=-1) | |||
|
357 | if move: | |||
|
358 | repo.dirstate.update([f], 'r') | |||
|
359 | if f != fd: | |||
|
360 | repo.dirstate.copy(f, fd) | |||
342 |
|
361 | |||
343 | def update(repo, node, branchmerge=False, force=False, partial=None, |
|
362 | def update(repo, node, branchmerge=False, force=False, partial=None, | |
344 | wlock=None, show_stats=True, remind=True): |
|
363 | wlock=None, show_stats=True, remind=True): |
@@ -3,6 +3,8 b'' | |||||
3 | mkdir t |
|
3 | mkdir t | |
4 | cd t |
|
4 | cd t | |
5 | hg init |
|
5 | hg init | |
|
6 | echo "[merge]" >> .hg/hgrc | |||
|
7 | echo "followcopies = 1" >> .hg/hgrc | |||
6 | echo foo > a |
|
8 | echo foo > a | |
7 | echo foo > a2 |
|
9 | echo foo > a2 | |
8 | hg add a a2 |
|
10 | hg add a a2 | |
@@ -18,6 +20,6 b' hg mv a2 c2' | |||||
18 | hg ci -m "modify" -d "0 0" |
|
20 | hg ci -m "modify" -d "0 0" | |
19 | echo "merge" |
|
21 | echo "merge" | |
20 | hg merge -y --debug |
|
22 | hg merge -y --debug | |
21 | cat a |
|
23 | hg status -AC | |
22 | cat b |
|
24 | cat b | |
23 | hg ci -m "merge" -d "0 0" |
|
25 | hg ci -m "merge" -d "0 0" |
@@ -4,11 +4,18 b' merge' | |||||
4 | resolving manifests |
|
4 | resolving manifests | |
5 | overwrite None branchmerge True partial False |
|
5 | overwrite None branchmerge True partial False | |
6 | ancestor f26ec4fc3fa3 local 8e765a822af2 remote af1939970a1c |
|
6 | ancestor f26ec4fc3fa3 local 8e765a822af2 remote af1939970a1c | |
7 |
|
|
7 | a: remote moved -> c | |
8 | b2: remote created -> g |
|
8 | b2: remote created -> g | |
9 | getting b |
|
9 | resolving a | |
|
10 | my a@f26ec4fc3fa3 other b@8e765a822af2 ancestor a@af1939970a1c | |||
|
11 | copying a to b | |||
|
12 | removing a | |||
10 | getting b2 |
|
13 | getting b2 | |
11 |
|
|
14 | 1 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
12 | (branch merge, don't forget to commit) |
|
15 | (branch merge, don't forget to commit) | |
|
16 | M b | |||
|
17 | a | |||
|
18 | M b2 | |||
|
19 | R a | |||
|
20 | C c2 | |||
13 | blahblah |
|
21 | blahblah | |
14 | foo |
|
General Comments 0
You need to be logged in to leave comments.
Login now