D7188: git: force using bytes in command name

maho (Maho) phabricator at mercurial-scm.org
Fri Nov 1 16:39:21 UTC 2019


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

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):



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


More information about the Mercurial-devel mailing list