##// END OF EJS Templates
merge: fix handling of deleted files
Alexis S. L. Carvalho -
r6242:a375ffc2 default
parent child Browse files
Show More
@@ -29,7 +29,7 b' def checkcollision(mctx):'
29 % (fn, folded[fold]))
29 % (fn, folded[fold]))
30 folded[fold] = fn
30 folded[fold] = fn
31
31
32 def forgetremoved(wctx, mctx):
32 def forgetremoved(wctx, mctx, branchmerge):
33 """
33 """
34 Forget removed files
34 Forget removed files
35
35
@@ -38,11 +38,21 b' def forgetremoved(wctx, mctx):'
38 then we need to remove it from the dirstate, to prevent the
38 then we need to remove it from the dirstate, to prevent the
39 dirstate from listing the file when it is no longer in the
39 dirstate from listing the file when it is no longer in the
40 manifest.
40 manifest.
41
42 If we're merging, and the other revision has removed a file
43 that is not present in the working directory, we need to mark it
44 as removed.
41 """
45 """
42
46
43 action = []
47 action = []
44 man = mctx.manifest()
48 man = mctx.manifest()
45 for f in wctx.deleted() + wctx.removed():
49 state = branchmerge and 'r' or 'f'
50 for f in wctx.deleted():
51 if f not in man:
52 action.append((f, state))
53
54 if not branchmerge:
55 for f in wctx.removed():
46 if f not in man:
56 if f not in man:
47 action.append((f, "f"))
57 action.append((f, "f"))
48
58
@@ -608,8 +618,7 b' def update(repo, node, branchmerge, forc'
608 checkunknown(wc, p2)
618 checkunknown(wc, p2)
609 if not util.checkfolding(repo.path):
619 if not util.checkfolding(repo.path):
610 checkcollision(p2)
620 checkcollision(p2)
611 if not branchmerge:
621 action += forgetremoved(wc, p2, branchmerge)
612 action += forgetremoved(wc, p2)
613 action += manifestmerge(repo, wc, p2, pa, overwrite, partial)
622 action += manifestmerge(repo, wc, p2, pa, overwrite, partial)
614
623
615 ### apply phase
624 ### apply phase
General Comments 0
You need to be logged in to leave comments. Login now