diff mercurial/merge.py @ 29785: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
line wrap: on
line diff
--- a/mercurial/merge.py	Tue Aug 09 09:15:46 2016 -0700
+++ b/mercurial/merge.py	Fri Aug 12 06:01:42 2016 -0700
@@ -1535,11 +1535,13 @@
         if '.hgsubstate' in actionbyfile:
             f = '.hgsubstate'
             m, args, msg = actionbyfile[f]
+            prompts = filemerge.partextras(labels)
+            prompts['f'] = f
             if m == 'cd':
                 if repo.ui.promptchoice(
-                    _("local changed %s which remote deleted\n"
+                    _("local%(l)s changed %(f)s which remote%(o)s deleted\n"
                       "use (c)hanged version or (d)elete?"
-                      "$$ &Changed $$ &Delete") % f, 0):
+                      "$$ &Changed $$ &Delete") % prompts, 0):
                     actionbyfile[f] = ('r', None, "prompt delete")
                 elif f in p1:
                     actionbyfile[f] = ('am', None, "prompt keep")
@@ -1549,9 +1551,9 @@
                 f1, f2, fa, move, anc = args
                 flags = p2[f2].flags()
                 if repo.ui.promptchoice(
-                    _("remote changed %s which local deleted\n"
+                    _("remote%(o)s changed %(f)s which local%(l)s deleted\n"
                       "use (c)hanged version or leave (d)eleted?"
-                      "$$ &Changed $$ &Deleted") % f, 0) == 0:
+                      "$$ &Changed $$ &Deleted") % prompts, 0) == 0:
                     actionbyfile[f] = ('g', (flags, False), "prompt recreating")
                 else:
                     del actionbyfile[f]