comparison mercurial/merge.py @ 29775:978b907d9b36

merge: always use other, not remote, in user prompts Now that we store and display merge labels in user prompts (not just conflict markets), we should rely on labels to clarify the two sides of a merge operation (hg merge, hg update, hg rebase etc). "remote" is not a great name here, as it conflates "remote" as in "remote server" with "remote" as in "the side of the merge that's further away". In cases where you're merging the "wrong way" around, remote can even be the "local" commit that you're merging with something pulled from the remote server.
author Simon Farnsworth <simonfar@fb.com>
date Fri, 12 Aug 2016 05:56:40 -0700
parents a7f8939641aa
children 1316c7cccc76
comparison
equal deleted inserted replaced
29774:a7f8939641aa 29775:978b907d9b36
1537 m, args, msg = actionbyfile[f] 1537 m, args, msg = actionbyfile[f]
1538 prompts = filemerge.partextras(labels) 1538 prompts = filemerge.partextras(labels)
1539 prompts['f'] = f 1539 prompts['f'] = f
1540 if m == 'cd': 1540 if m == 'cd':
1541 if repo.ui.promptchoice( 1541 if repo.ui.promptchoice(
1542 _("local%(l)s changed %(f)s which remote%(o)s deleted\n" 1542 _("local%(l)s changed %(f)s which other%(o)s deleted\n"
1543 "use (c)hanged version or (d)elete?" 1543 "use (c)hanged version or (d)elete?"
1544 "$$ &Changed $$ &Delete") % prompts, 0): 1544 "$$ &Changed $$ &Delete") % prompts, 0):
1545 actionbyfile[f] = ('r', None, "prompt delete") 1545 actionbyfile[f] = ('r', None, "prompt delete")
1546 elif f in p1: 1546 elif f in p1:
1547 actionbyfile[f] = ('am', None, "prompt keep") 1547 actionbyfile[f] = ('am', None, "prompt keep")
1549 actionbyfile[f] = ('a', None, "prompt keep") 1549 actionbyfile[f] = ('a', None, "prompt keep")
1550 elif m == 'dc': 1550 elif m == 'dc':
1551 f1, f2, fa, move, anc = args 1551 f1, f2, fa, move, anc = args
1552 flags = p2[f2].flags() 1552 flags = p2[f2].flags()
1553 if repo.ui.promptchoice( 1553 if repo.ui.promptchoice(
1554 _("remote%(o)s changed %(f)s which local%(l)s deleted\n" 1554 _("other%(o)s changed %(f)s which local%(l)s deleted\n"
1555 "use (c)hanged version or leave (d)eleted?" 1555 "use (c)hanged version or leave (d)eleted?"
1556 "$$ &Changed $$ &Deleted") % prompts, 0) == 0: 1556 "$$ &Changed $$ &Deleted") % prompts, 0) == 0:
1557 actionbyfile[f] = ('g', (flags, False), "prompt recreating") 1557 actionbyfile[f] = ('g', (flags, False), "prompt recreating")
1558 else: 1558 else:
1559 del actionbyfile[f] 1559 del actionbyfile[f]