comparison mercurial/merge.py @ 26962:fa2daf0e61ab

merge: make 'cd' and 'dc' actions store the same arguments as 'm' We're going to treat these conflicts similarly to merge conflicts, and this change to the way we store things in memory makes future code a lot simpler.
author Siddharth Agarwal <sid0@fb.com>
date Fri, 13 Nov 2015 22:43:09 -0800
parents 042422f3a773
children 6618dfd3ea1c
comparison
equal deleted inserted replaced
26961:042422f3a773 26962:fa2daf0e61ab
621 elif f in ma: # clean, a different, no remote 621 elif f in ma: # clean, a different, no remote
622 if n1 != ma[f]: 622 if n1 != ma[f]:
623 if acceptremote: 623 if acceptremote:
624 actions[f] = ('r', None, "remote delete") 624 actions[f] = ('r', None, "remote delete")
625 else: 625 else:
626 actions[f] = ('cd', None, "prompt changed/deleted") 626 actions[f] = ('cd', (f, None, f, False, pa.node()),
627 "prompt changed/deleted")
627 elif n1[20:] == 'a': 628 elif n1[20:] == 'a':
628 # This extra 'a' is added by working copy manifest to mark 629 # This extra 'a' is added by working copy manifest to mark
629 # the file as locally added. We should forget it instead of 630 # the file as locally added. We should forget it instead of
630 # deleting it. 631 # deleting it.
631 actions[f] = ('f', None, "remote deleted") 632 actions[f] = ('f', None, "remote deleted")
671 "remote created, get or merge") 672 "remote created, get or merge")
672 elif n2 != ma[f]: 673 elif n2 != ma[f]:
673 if acceptremote: 674 if acceptremote:
674 actions[f] = ('c', (fl2,), "remote recreating") 675 actions[f] = ('c', (fl2,), "remote recreating")
675 else: 676 else:
676 actions[f] = ('dc', (fl2,), "prompt deleted/changed") 677 actions[f] = ('dc', (None, f, f, False, pa.node()),
678 "prompt deleted/changed")
677 679
678 return actions, diverge, renamedelete 680 return actions, diverge, renamedelete
679 681
680 def _resolvetrivial(repo, wctx, mctx, ancestor, actions): 682 def _resolvetrivial(repo, wctx, mctx, ancestor, actions):
681 """Resolves false conflicts where the nodeid changed but the content 683 """Resolves false conflicts where the nodeid changed but the content
1262 actions['r'].append((f, None, "prompt delete")) 1264 actions['r'].append((f, None, "prompt delete"))
1263 else: 1265 else:
1264 actions['a'].append((f, None, "prompt keep")) 1266 actions['a'].append((f, None, "prompt keep"))
1265 1267
1266 for f, args, msg in sorted(actions['dc']): 1268 for f, args, msg in sorted(actions['dc']):
1267 flags, = args 1269 f1, f2, fa, move, anc = args
1270 flags = p2[f2].flags()
1268 if repo.ui.promptchoice( 1271 if repo.ui.promptchoice(
1269 _("remote changed %s which local deleted\n" 1272 _("remote changed %s which local deleted\n"
1270 "use (c)hanged version or leave (d)eleted?" 1273 "use (c)hanged version or leave (d)eleted?"
1271 "$$ &Changed $$ &Deleted") % f, 0) == 0: 1274 "$$ &Changed $$ &Deleted") % f, 0) == 0:
1272 actions['g'].append((f, (flags,), "prompt recreating")) 1275 actions['g'].append((f, (flags,), "prompt recreating"))