Patchwork D1631: py3: handle keyword arguments correctly in exchange.py

login
register
mail settings
Submitter phabricator
Date Dec. 10, 2017, 1:09 a.m.
Message ID <differential-rev-PHID-DREV-5fkvzwui2w7x63m4wm7i-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/26150/
State Superseded
Headers show

Comments

phabricator - Dec. 10, 2017, 1:09 a.m.
pulkit 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/D1631

AFFECTED FILES
  mercurial/exchange.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -1333,7 +1333,8 @@ 
     if opargs is None:
         opargs = {}
     pullop = pulloperation(repo, remote, heads, force, bookmarks=bookmarks,
-                           streamclonerequested=streamclonerequested, **opargs)
+                           streamclonerequested=streamclonerequested,
+                           **pycompat.strkwargs(opargs))
 
     peerlocal = pullop.remote.local()
     if peerlocal:
@@ -1757,7 +1758,7 @@ 
                               b2caps=None, heads=None, common=None, **kwargs):
     """add a changegroup part to the requested bundle"""
     cgstream = None
-    if kwargs.get('cg', True):
+    if kwargs.get(r'cg', True):
         # build changegroup bundle here.
         version = '01'
         cgversions = b2caps.get('changegroup')
@@ -1785,7 +1786,7 @@ 
 def _getbundlebookmarkpart(bundler, repo, source, bundlecaps=None,
                               b2caps=None, **kwargs):
     """add a bookmark part to the requested bundle"""
-    if not kwargs.get('bookmarks', False):
+    if not kwargs.get(r'bookmarks', False):
         return
     if 'bookmarks' not in b2caps:
         raise ValueError(_('no common bookmarks exchange method'))
@@ -1798,7 +1799,7 @@ 
 def _getbundlelistkeysparts(bundler, repo, source, bundlecaps=None,
                             b2caps=None, **kwargs):
     """add parts containing listkeys namespaces to the requested bundle"""
-    listkeys = kwargs.get('listkeys', ())
+    listkeys = kwargs.get(r'listkeys', ())
     for namespace in listkeys:
         part = bundler.newpart('listkeys')
         part.addparam('namespace', namespace)
@@ -1809,7 +1810,7 @@ 
 def _getbundleobsmarkerpart(bundler, repo, source, bundlecaps=None,
                             b2caps=None, heads=None, **kwargs):
     """add an obsolescence markers part to the requested bundle"""
-    if kwargs.get('obsmarkers', False):
+    if kwargs.get(r'obsmarkers', False):
         if heads is None:
             heads = repo.heads()
         subset = [c.node() for c in repo.set('::%ln', heads)]
@@ -1821,7 +1822,7 @@ 
 def _getbundlephasespart(bundler, repo, source, bundlecaps=None,
                             b2caps=None, heads=None, **kwargs):
     """add phase heads part to the requested bundle"""
-    if kwargs.get('phases', False):
+    if kwargs.get(r'phases', False):
         if not 'heads' in b2caps.get('phases'):
             raise ValueError(_('no common phases exchange method'))
         if heads is None:
@@ -1878,7 +1879,7 @@ 
     # Don't send unless:
     # - changeset are being exchanged,
     # - the client supports it.
-    if not (kwargs.get('cg', True) and 'hgtagsfnodes' in b2caps):
+    if not (kwargs.get(r'cg', True) and 'hgtagsfnodes' in b2caps):
         return
 
     outgoing = _computeoutgoing(repo, heads, common)