merge: simplify prompt code
authorMatt Mackall <mpm@selenic.com>
Sun, 17 Sep 2006 20:43:06 -0500
changeset 3119 b1de36a4b4df
parent 3118 5644a05a608c
child 3120 1c1e59aac82a
merge: simplify prompt code
mercurial/merge.py
--- a/mercurial/merge.py	Sun Sep 17 20:38:02 2006 -0500
+++ b/mercurial/merge.py	Sun Sep 17 20:43:06 2006 -0500
@@ -142,10 +142,9 @@
             del m2[f]
         elif f in ma:
             if n != ma[f] and not overwrite:
-                r = ui.prompt(
+                if ui.prompt(
                     (_(" local changed %s which remote deleted\n") % f) +
-                    _("(k)eep or (d)elete?"), _("[kd]"), _("k"))
-                if r == _("d"):
+                    _("(k)eep or (d)elete?"), _("[kd]"), _("k")) == _("d"):
                     action.append((f, "r"))
             else:
                 ui.debug(_("other deleted %s\n") % f)
@@ -170,10 +169,9 @@
                 ui.debug(_("local deleted %s, recreating\n") % f)
                 action.append((f, "g", m2.execf(f), n))
             elif n != ma[f]:
-                r = ui.prompt(
+                if ui.prompt(
                     (_("remote changed %s which local deleted\n") % f) +
-                    _("(k)eep or (d)elete?"), _("[kd]"), _("k"))
-                if r == _("k"):
+                    _("(k)eep or (d)elete?"), _("[kd]"), _("k")) == _("k"):
                     action.append((f, "g", m2.execf(f), n))
             else:
                 ui.debug(_("local deleted %s\n") % f)