# HG changeset patch # User Siddharth Agarwal # Date 2015-11-02 20:12:24 # Node ID 859f453e8b4e2b42b6b6552b79c5c5e7e2fc1cf7 # Parent 00209e38e7d96248436ad9b807dead70422db12a filemerge.prompt: separate out choice selection and action This will make future patches cleaner. 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)