D7189: git: use bytes in command name, not unicode

2019-11-01 Thread maho (Maho)
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/D7189

AFFECTED FILES
  hgext/git/__init__.py

CHANGE DETAILS

diff --git a/hgext/git/__init__.py b/hgext/git/__init__.py
--- a/hgext/git/__init__.py
+++ b/hgext/git/__init__.py
@@ -225,5 +225,5 @@
 extensions.wrapfunction(localrepo, 'makestore', _makestore)
 extensions.wrapfunction(localrepo, 'makefilestorage', _makefilestorage)
 # Inject --git flag for `hg init`
-entry = extensions.wrapcommand(commands.table, 'init', init)
+entry = extensions.wrapcommand(commands.table, b'init', init)
 entry[1].extend([('', 'git', None, 'setup up a git repository instead of 
hg')])



To: maho, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7188: git: force using bytes in command name

2019-11-01 Thread maho (Maho)
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
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel