# HG changeset patch # User Martin von Zweigbergk # Date 2019-12-18 19:11:40 # Node ID 6c8108274dc5694528e6a84d14e335828a81009e # Parent dfac25883dbf45df0e0a0008e4c97b09ab6fe431 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 diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -267,7 +267,7 @@ def check_at_most_one_arg(opts, *args): """ def to_display(name): - return name.replace(b'_', b'-') + return pycompat.sysbytes(name).replace(b'_', b'-') previous = None for x in args: