changeset 4108:ef3c9ecb8099

cmdrewrite: rename variable and move it closer to where it is used Renaming to satisfy pep8-naming linter plugin, which complained on this variable because all-uppercase names are reserved for constants, and constants need to be module-level. This variable is not a good choice for moving up to the module level because it's used only in one place. Additionally, let's have it closer to the place it's actually used to potentially avoid an extra call to _() function (however cheap it may be).
author Anton Shestakov <av6@dwimlabs.net>
date Thu, 13 Sep 2018 00:04:17 +0800
parents aabf436c11cb
children b3b861a7f6f7
files hgext3rd/evolve/cmdrewrite.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/cmdrewrite.py	Tue Sep 04 19:30:19 2018 +0800
+++ b/hgext3rd/evolve/cmdrewrite.py	Thu Sep 13 00:04:17 2018 +0800
@@ -186,7 +186,6 @@
         lockmod.release(lock, wlock)
 
 def _editandapply(ui, repo, pats, old, p1, fp, diffopts):
-    RETRYCHOICE = _('try to fix the patch (yn)?$$ &Yes $$ &No')
     newnode = None
     while newnode is None:
         fp.seek(0)
@@ -220,7 +219,8 @@
             defaultchoice = 0 # yes
             if not ui.interactive:
                 defaultchoice = 1 # no
-            if ui.promptchoice(RETRYCHOICE, default=defaultchoice):
+            retrychoice = _('try to fix the patch (yn)?$$ &Yes $$ &No')
+            if ui.promptchoice(retrychoice, default=defaultchoice):
                 raise error.Abort(_("Could not apply amended path"))
             else:
                 # consider a third choice where we restore the original patch