##// END OF EJS Templates
merge: add a new action type representing files to add/mark as modified...
Siddharth Agarwal -
r27131:d837da26 default
parent child Browse files
Show More
@@ -479,6 +479,9 b' class mergestate(object):'
479 479 if fcd.isabsent(): # dc: remote picked
480 480 action = 'g'
481 481 elif fco.isabsent(): # cd: local picked
482 if dfile in self.localctx:
483 action = 'am'
484 else:
482 485 action = 'a'
483 486 # else: regular merges (no action necessary)
484 487 self._results[dfile] = r, action
@@ -524,7 +527,7 b' class mergestate(object):'
524 527
525 528 def actions(self):
526 529 """return lists of actions to perform on the dirstate"""
527 actions = {'r': [], 'f': [], 'a': [], 'g': []}
530 actions = {'r': [], 'f': [], 'a': [], 'am': [], 'g': []}
528 531 for f, (r, action) in self._results.iteritems():
529 532 if action is not None:
530 533 actions[action].append((f, None, "merge result"))
@@ -631,7 +634,7 b' def _checkcollision(repo, wmf, actions):'
631 634
632 635 if actions:
633 636 # k, dr, e and rd are no-op
634 for m in 'a', 'f', 'g', 'cd', 'dc':
637 for m in 'a', 'am', 'f', 'g', 'cd', 'dc':
635 638 for f, args, msg in actions[m]:
636 639 pmmf.add(f)
637 640 for f, args, msg in actions['r']:
@@ -1065,6 +1068,12 b' def applyupdates(repo, actions, wctx, mc'
1065 1068 z += 1
1066 1069 progress(_updating, z, item=f, total=numupdates, unit=_files)
1067 1070
1071 # re-add/mark as modified (manifest only, just log it)
1072 for f, args, msg in actions['am']:
1073 repo.ui.debug(" %s: %s -> am\n" % (f, msg))
1074 z += 1
1075 progress(_updating, z, item=f, total=numupdates, unit=_files)
1076
1068 1077 # keep (noop, just log it)
1069 1078 for f, args, msg in actions['k']:
1070 1079 repo.ui.debug(" %s: %s -> k\n" % (f, msg))
@@ -1189,6 +1198,13 b' def recordupdates(repo, actions, branchm'
1189 1198 if not branchmerge:
1190 1199 repo.dirstate.add(f)
1191 1200
1201 # re-add/mark as modified
1202 for f, args, msg in actions.get('am', []):
1203 if branchmerge:
1204 repo.dirstate.normallookup(f)
1205 else:
1206 repo.dirstate.add(f)
1207
1192 1208 # exec change
1193 1209 for f, args, msg in actions.get('e', []):
1194 1210 repo.dirstate.normallookup(f)
@@ -1390,7 +1406,7 b' def update(repo, node, branchmerge, forc'
1390 1406 repo, wc, p2, pas, branchmerge, force, partial, mergeancestor,
1391 1407 followcopies)
1392 1408 # Convert to dictionary-of-lists format
1393 actions = dict((m, []) for m in 'a f g cd dc r dm dg m e k'.split())
1409 actions = dict((m, []) for m in 'a am f g cd dc r dm dg m e k'.split())
1394 1410 for f, (m, args, msg) in actionbyfile.iteritems():
1395 1411 if m not in actions:
1396 1412 actions[m] = []
@@ -1411,6 +1427,8 b' def update(repo, node, branchmerge, forc'
1411 1427 "use (c)hanged version or (d)elete?"
1412 1428 "$$ &Changed $$ &Delete") % f, 0):
1413 1429 actions['r'].append((f, None, "prompt delete"))
1430 elif f in p1:
1431 actions['am'].append((f, None, "prompt keep"))
1414 1432 else:
1415 1433 actions['a'].append((f, None, "prompt keep"))
1416 1434
@@ -725,7 +725,7 b' m "um a c" "um x c" " " "10 do merg'
725 725 use (c)hanged version or (d)elete? c
726 726 preserving b for resolve of b
727 727 preserving rev for resolve of rev
728 a: prompt keep -> a
728 a: prompt keep -> am
729 729 b: both created -> m (premerge)
730 730 picked tool 'python ../merge' for b (binary False symlink False)
731 731 merging b
General Comments 0
You need to be logged in to leave comments. Login now