changeset 43948:6c8108274dc5

cmdutil: allow native string as input to check_at_most_one_arg() We seem to always convert **opts args to use bytes as keys early on in Mercurial core, but I'm not sure we have good reason to do that, and not all extensions do that. It's therefore helpful to be able to pass in a native string to check_at_most_one_arg(). Differential Revision: https://phab.mercurial-scm.org/D7699
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 18 Dec 2019 11:11:40 -0800
parents dfac25883dbf
children 0671f0a19d93
files mercurial/cmdutil.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Wed Dec 18 10:52:49 2019 -0800
+++ b/mercurial/cmdutil.py	Wed Dec 18 11:11:40 2019 -0800
@@ -267,7 +267,7 @@
     """
 
     def to_display(name):
-        return name.replace(b'_', b'-')
+        return pycompat.sysbytes(name).replace(b'_', b'-')
 
     previous = None
     for x in args: