##// END OF EJS Templates
merge: simplify some helpers
Matt Mackall -
r6272:dd9bd227 default
parent child Browse files
Show More
@@ -11,18 +11,15 b' import errno, util, os, heapq, filemerge'
11 11
12 12 def _checkunknown(wctx, mctx):
13 13 "check for collisions between unknown files and files in mctx"
14 man = mctx.manifest()
15 14 for f in wctx.unknown():
16 if f in man:
17 if mctx.filectx(f).cmp(wctx.filectx(f).data()):
18 raise util.Abort(_("untracked file in working directory differs"
19 " from file in requested revision: '%s'")
20 % f)
15 if f in mctx and mctx[f].cmp(wctx[f].data()):
16 raise util.Abort(_("untracked file in working directory differs"
17 " from file in requested revision: '%s'") % f)
21 18
22 19 def _checkcollision(mctx):
23 20 "check for case folding collisions in the destination context"
24 21 folded = {}
25 for fn in mctx.manifest():
22 for fn in mctx:
26 23 fold = fn.lower()
27 24 if fold in folded:
28 25 raise util.Abort(_("case-folding collision between %s and %s")
@@ -45,15 +42,14 b' def _forgetremoved(wctx, mctx, branchmer'
45 42 """
46 43
47 44 action = []
48 man = mctx.manifest()
49 45 state = branchmerge and 'r' or 'f'
50 46 for f in wctx.deleted():
51 if f not in man:
47 if f not in mctx:
52 48 action.append((f, state))
53 49
54 50 if not branchmerge:
55 51 for f in wctx.removed():
56 if f not in man:
52 if f not in mctx:
57 53 action.append((f, "f"))
58 54
59 55 return action
General Comments 0
You need to be logged in to leave comments. Login now