Patchwork D2367: narrowcommands: add some missing strkwargs calls for py3

login
register
mail settings
Submitter phabricator
Date Feb. 21, 2018, 5:42 p.m.
Message ID <differential-rev-PHID-DREV-foc2ds53bwxytd42qbfg-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28194/
State Superseded
Headers show

Comments

phabricator - Feb. 21, 2018, 5:42 p.m.
durin42 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/D2367

AFFECTED FILES
  hgext/narrow/narrowcommands.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel
phabricator - Feb. 21, 2018, 5:56 p.m.
pulkit added inline comments.

INLINE COMMENTS

> narrowcommands.py:146
>              opts['exclude'] = excludes
> +        opts = pycompat.strkwargs(opts)
>      return orig(ui, repo, *args, **opts)

What about adding r'' prefixes to prevent the the function calls which iterate over all the keys and encode/decode them?

REPOSITORY
  rHG Mercurial

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

To: durin42, #hg-reviewers
Cc: pulkit, mercurial-devel
phabricator - Feb. 22, 2018, 3:12 a.m.
indygreg requested changes to this revision.
indygreg added a comment.
This revision now requires changes to proceed.


  Let's do what @pulkit said.

REPOSITORY
  rHG Mercurial

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

To: durin42, #hg-reviewers, indygreg
Cc: indygreg, pulkit, mercurial-devel
phabricator - Feb. 22, 2018, 2:48 p.m.
pulkit added a comment.


  This one got pushed with a wrong commit message.

REPOSITORY
  rHG Mercurial

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

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

Patch

diff --git a/hgext/narrow/narrowcommands.py b/hgext/narrow/narrowcommands.py
--- a/hgext/narrow/narrowcommands.py
+++ b/hgext/narrow/narrowcommands.py
@@ -133,6 +133,7 @@ 
 def archivenarrowcmd(orig, ui, repo, *args, **opts):
     """Wraps archive command to narrow the default includes."""
     if narrowrepo.REQUIREMENT in repo.requirements:
+        opts = pycompat.byteskwargs(opts)
         repo_includes, repo_excludes = repo.narrowpats
         includes = set(opts.get('include', []))
         excludes = set(opts.get('exclude', []))
@@ -142,6 +143,7 @@ 
             opts['include'] = includes
         if excludes:
             opts['exclude'] = excludes
+        opts = pycompat.strkwargs(opts)
     return orig(ui, repo, *args, **opts)
 
 def pullbundle2extraprepare(orig, pullop, kwargs):