D4455: py3: handle keyword arguments correctly in hgext/acl.py

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Tue Sep 4 15:17:49 UTC 2018


pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The keys of keyword arguments on python 3 should be str, so when we try to get
  some key from them, we must make sure we are using str.
  
  1. skip-blame because just b'' prefix

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/acl.py

CHANGE DETAILS

diff --git a/hgext/acl.py b/hgext/acl.py
--- a/hgext/acl.py
+++ b/hgext/acl.py
@@ -375,9 +375,9 @@
         _txnhook(ui, repo, hooktype, node, source, user, **kwargs)
 
 def _pkhook(ui, repo, hooktype, node, source, user, **kwargs):
-    if kwargs['namespace'] == 'bookmarks':
-        bookmark = kwargs['key']
-        ctx = kwargs['new']
+    if kwargs[r'namespace'] == 'bookmarks':
+        bookmark = kwargs[r'key']
+        ctx = kwargs[r'new']
         allowbookmarks = buildmatch(ui, None, user, 'acl.allow.bookmarks')
         denybookmarks = buildmatch(ui, None, user, 'acl.deny.bookmarks')
 



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


More information about the Mercurial-devel mailing list