mercurial/cmdutil.py
changeset 43941 dfac25883dbf
parent 43939 07ebb567e8bb
child 43942 6c8108274dc5
--- a/mercurial/cmdutil.py	Wed Dec 18 10:55:06 2019 -0800
+++ b/mercurial/cmdutil.py	Wed Dec 18 10:52:49 2019 -0800
@@ -265,13 +265,17 @@
 
     Returns the unique argument or None if none of them were specified.
     """
+
+    def to_display(name):
+        return name.replace(b'_', b'-')
+
     previous = None
     for x in args:
         if opts.get(x):
-            x = x.replace(b'_', b'-')
             if previous:
                 raise error.Abort(
-                    _(b'cannot specify both --%s and --%s') % (previous, x)
+                    _(b'cannot specify both --%s and --%s')
+                    % (to_display(previous), to_display(x))
                 )
             previous = x
     return previous