Patchwork D7188: git: force using bytes in command name

login
register
mail settings
Submitter phabricator
Date Nov. 1, 2019, 4:39 p.m.
Message ID <differential-rev-PHID-DREV-fmi4al2ftlzzguhmwaef-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/42653/
State New
Headers show

Comments

phabricator - Nov. 1, 2019, 4:39 p.m.
maho created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7188

AFFECTED FILES
  mercurial/extensions.py

CHANGE DETAILS




To: maho, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/extensions.py b/mercurial/extensions.py
--- a/mercurial/extensions.py
+++ b/mercurial/extensions.py
@@ -549,6 +549,8 @@ 
       extensions.wrapcommand(commands.table, 'bookmarks', exbookmarks,
                              synopsis, docstring)
     '''
+    assert command == stringutil.forcebytestr(command), \
+        "`command` should be bytes(python3)/str(python2)"
     assert callable(wrapper)
     aliases, entry = cmdutil.findcmd(command, table)
     for alias, e in pycompat.iteritems(table):