Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/cmdutil.py @ 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 | 6cfaebb625d3 |
comparison
equal
deleted
inserted
replaced
43947:dfac25883dbf | 43948:6c8108274dc5 |
---|---|
265 | 265 |
266 Returns the unique argument or None if none of them were specified. | 266 Returns the unique argument or None if none of them were specified. |
267 """ | 267 """ |
268 | 268 |
269 def to_display(name): | 269 def to_display(name): |
270 return name.replace(b'_', b'-') | 270 return pycompat.sysbytes(name).replace(b'_', b'-') |
271 | 271 |
272 previous = None | 272 previous = None |
273 for x in args: | 273 for x in args: |
274 if opts.get(x): | 274 if opts.get(x): |
275 if previous: | 275 if previous: |