Mercurial > public > mercurial-scm > hg
comparison mercurial/merge.py @ 29774:a7f8939641aa
merge: use labels in prompts to the user
Now that we persist the labels, we can consistently use the labels in
prompts for the user without risk of confusion. This changes a huge amount
of command output:
This means that merge prompts like:
no tool found to merge a
keep (l)ocal, take (o)ther, or leave (u)nresolved? u
and
remote changed a which local deleted
use (c)hanged version, leave (d)eleted, or leave (u)nresolved? c
become:
no tool found to merge a
keep (l)ocal [working copy], take (o)ther [destination], or leave (u)nresolved? u
and
remote [source] changed a which local [dest] deleted
use (c)hanged version, leave (d)eleted, or leave (u)nresolved? c
where "working copy" and "destination" were supplied by the command that
requested the merge as labels for conflict markers, and thus should be
human-friendly.
author | Simon Farnsworth <simonfar@fb.com> |
---|---|
date | Fri, 12 Aug 2016 06:01:42 -0700 |
parents | b33c0c38d68f |
children | 978b907d9b36 |
comparison
equal
deleted
inserted
replaced
29773:f2241c13d5a1 | 29774:a7f8939641aa |
---|---|
1533 # already, but we can't handle .hgsubstate in filemerge or | 1533 # already, but we can't handle .hgsubstate in filemerge or |
1534 # subrepo.submerge yet so we have to keep prompting for it. | 1534 # subrepo.submerge yet so we have to keep prompting for it. |
1535 if '.hgsubstate' in actionbyfile: | 1535 if '.hgsubstate' in actionbyfile: |
1536 f = '.hgsubstate' | 1536 f = '.hgsubstate' |
1537 m, args, msg = actionbyfile[f] | 1537 m, args, msg = actionbyfile[f] |
1538 prompts = filemerge.partextras(labels) | |
1539 prompts['f'] = f | |
1538 if m == 'cd': | 1540 if m == 'cd': |
1539 if repo.ui.promptchoice( | 1541 if repo.ui.promptchoice( |
1540 _("local changed %s which remote deleted\n" | 1542 _("local%(l)s changed %(f)s which remote%(o)s deleted\n" |
1541 "use (c)hanged version or (d)elete?" | 1543 "use (c)hanged version or (d)elete?" |
1542 "$$ &Changed $$ &Delete") % f, 0): | 1544 "$$ &Changed $$ &Delete") % prompts, 0): |
1543 actionbyfile[f] = ('r', None, "prompt delete") | 1545 actionbyfile[f] = ('r', None, "prompt delete") |
1544 elif f in p1: | 1546 elif f in p1: |
1545 actionbyfile[f] = ('am', None, "prompt keep") | 1547 actionbyfile[f] = ('am', None, "prompt keep") |
1546 else: | 1548 else: |
1547 actionbyfile[f] = ('a', None, "prompt keep") | 1549 actionbyfile[f] = ('a', None, "prompt keep") |
1548 elif m == 'dc': | 1550 elif m == 'dc': |
1549 f1, f2, fa, move, anc = args | 1551 f1, f2, fa, move, anc = args |
1550 flags = p2[f2].flags() | 1552 flags = p2[f2].flags() |
1551 if repo.ui.promptchoice( | 1553 if repo.ui.promptchoice( |
1552 _("remote changed %s which local deleted\n" | 1554 _("remote%(o)s changed %(f)s which local%(l)s deleted\n" |
1553 "use (c)hanged version or leave (d)eleted?" | 1555 "use (c)hanged version or leave (d)eleted?" |
1554 "$$ &Changed $$ &Deleted") % f, 0) == 0: | 1556 "$$ &Changed $$ &Deleted") % prompts, 0) == 0: |
1555 actionbyfile[f] = ('g', (flags, False), "prompt recreating") | 1557 actionbyfile[f] = ('g', (flags, False), "prompt recreating") |
1556 else: | 1558 else: |
1557 del actionbyfile[f] | 1559 del actionbyfile[f] |
1558 | 1560 |
1559 # Convert to dictionary-of-lists format | 1561 # Convert to dictionary-of-lists format |