[PATCH 2 of 2] merge: add choices to ui.prompt() calls

Steve Borho steve at borho.org
Mon Apr 27 23:11:10 CDT 2009


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1240891040 18000
# Node ID 1c802393be7fe36ab843efc9098658d554f54b88
# Parent  2787668ae94d642a9ace6d9b37826d2f22581be7
merge: add choices to ui.prompt() calls

This allows applications to generate more meaningful multiple
choice dialogs.

diff -r 2787668ae94d -r 1c802393be7f mercurial/merge.py
--- a/mercurial/merge.py	Mon Apr 27 22:46:57 2009 -0500
+++ b/mercurial/merge.py	Mon Apr 27 22:57:20 2009 -0500
@@ -147,7 +147,8 @@
             if not a: # both differ from parent
                 r = repo.ui.prompt(
                     _(" conflicting flags for %s\n"
-                      "(n)one, e(x)ec or sym(l)ink?") % f, "[nxl]", "n")
+                      "(n)one, e(x)ec or sym(l)ink?") % f, "[nxl]", "n",
+                    {_("None"):_("n"), _("Exec"):_("x"), _("Symlink"):_("l")})
                 return r != "n" and r or ''
             if m == a:
                 return n # changed from m to n
@@ -219,7 +220,8 @@
                 if repo.ui.prompt(
                     _(" local changed %s which remote deleted\n"
                       "use (c)hanged version or (d)elete?") % f,
-                    _("[cd]"), _("c")) == _("d"):
+                    _("[cd]"), _("c"),
+                    {_("Changed"):_("c"), _("Delete"):_("d")}) == _("d"):
                     act("prompt delete", "r", f)
                 act("prompt keep", "a", f)
             else:
@@ -254,7 +256,8 @@
                 if repo.ui.prompt(
                     _("remote changed %s which local deleted\n"
                       "use (c)hanged version or leave (d)eleted?") % f,
-                    _("[cd]"), _("c")) == _("c"):
+                    _("[cd]"), _("c"),
+                    {_("Changed"):_("c"), _("Delete"):_("d")}) == _("c"):
                     act("prompt recreating", "g", f, m2.flags(f))
         else:
             act("remote created", "g", f, m2.flags(f))


More information about the Mercurial-devel mailing list