Patchwork [5,of,5] filemerge.prompt: separate out choice selection and action

login
register
mail settings
Submitter Siddharth Agarwal
Date Nov. 2, 2015, 8:26 p.m.
Message ID <5d63b5f87c9bc2353781.1446495994@dev6666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/11265/
State Accepted
Headers show

Comments

Siddharth Agarwal - Nov. 2, 2015, 8:26 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1446495144 28800
#      Mon Nov 02 12:12:24 2015 -0800
# Branch stable
# Node ID 5d63b5f87c9bc23537818a2b2d8ec9c740a067ea
# Parent  a61553db98c038aba120a535e0edff65960836a5
filemerge.prompt: separate out choice selection and action

This will make future patches cleaner.
Matt Mackall - Nov. 2, 2015, 9:03 p.m.
On Mon, 2015-11-02 at 12:26 -0800, Siddharth Agarwal wrote:
> # HG changeset patch
> # User Siddharth Agarwal <sid0@fb.com>
> # Date 1446495144 28800
> #      Mon Nov 02 12:12:24 2015 -0800
> # Branch stable
> # Node ID 5d63b5f87c9bc23537818a2b2d8ec9c740a067ea
> # Parent  a61553db98c038aba120a535e0edff65960836a5
> filemerge.prompt: separate out choice selection and action

These are queued for default, thanks.

Patch

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -175,9 +175,12 @@  def _iprompt(repo, mynode, orig, fcd, fc
     ui = repo.ui
     fd = fcd.path()
 
-    if ui.promptchoice(_(" no tool found to merge %s\n"
-                         "keep (l)ocal or take (o)ther?"
-                         "$$ &Local $$ &Other") % fd, 0):
+    index = ui.promptchoice(_(" no tool found to merge %s\n"
+                              "keep (l)ocal or take (o)ther?"
+                              "$$ &Local $$ &Other") % fd, 0)
+    choice = ['local', 'other'][index]
+
+    if choice == 'other':
         return _iother(repo, mynode, orig, fcd, fco, fca, toolconf)
     else:
         return _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf)