Patchwork D2366: narrowwirepeer: add some strkwargs to fix a crash on py3

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

Comments

phabricator - Feb. 21, 2018, 5:41 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/D2366

AFFECTED FILES
  hgext/narrow/narrowwirepeer.py

CHANGE DETAILS




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

INLINE COMMENTS

> narrowwirepeer.py:51
>                  kwargs["excludepats"] = ','.join(exclude)
> -            return orig(cmd, *args, **kwargs)
> +            return orig(cmd, *args, **pycompat.strkwargs(kwargs))
>          extensions.wrapfunction(peer, '_calltwowaystream', wrapped)

I think better would be to add r'' prefixes as in above two lines as that will save a call to strkwargs.

REPOSITORY
  rHG Mercurial

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

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

INLINE COMMENTS

> pulkit wrote in narrowwirepeer.py:51
> I think better would be to add r'' prefixes as in above two lines as that will save a call to strkwargs.

I agree.

REPOSITORY
  rHG Mercurial

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

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

Patch

diff --git a/hgext/narrow/narrowwirepeer.py b/hgext/narrow/narrowwirepeer.py
--- a/hgext/narrow/narrowwirepeer.py
+++ b/hgext/narrow/narrowwirepeer.py
@@ -14,6 +14,7 @@ 
     hg,
     narrowspec,
     node,
+    pycompat,
 )
 
 def uisetup():
@@ -47,6 +48,6 @@ 
                 include, exclude = repo.narrowpats
                 kwargs["includepats"] = ','.join(include)
                 kwargs["excludepats"] = ','.join(exclude)
-            return orig(cmd, *args, **kwargs)
+            return orig(cmd, *args, **pycompat.strkwargs(kwargs))
         extensions.wrapfunction(peer, '_calltwowaystream', wrapped)
     hg.wirepeersetupfuncs.append(wirereposetup)