Patchwork D3276: py3: prevent transformer from adding b'' by adding r'' prefix

login
register
mail settings
Submitter phabricator
Date April 12, 2018, 3:04 p.m.
Message ID <26435630bd727f5313305ce04041cf0a@localhost.localdomain>
Download mbox | patch
Permalink /patch/30789/
State Not Applicable
Headers show

Comments

phabricator - April 12, 2018, 3:04 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG56df2ca5c032: py3: prevent transformer from adding b&#039;&#039; by adding r&#039;&#039; prefix (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3276?vs=8043&id=8056

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

AFFECTED FILES
  hgext/infinitepush/__init__.py
  mercurial/subrepo.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -1637,7 +1637,7 @@ 
         # This should be much faster than manually traversing the trees
         # and objects with many subprocess calls.
         tarstream = self._gitcommand(['archive', revision], stream=True)
-        tar = tarfile.open(fileobj=tarstream, mode='r|')
+        tar = tarfile.open(fileobj=tarstream, mode=r'r|')
         relpath = subrelpath(self)
         self.ui.progress(_('archiving (%s)') % relpath, 0, unit=_('files'))
         for i, info in enumerate(tar):
diff --git a/hgext/infinitepush/__init__.py b/hgext/infinitepush/__init__.py
--- a/hgext/infinitepush/__init__.py
+++ b/hgext/infinitepush/__init__.py
@@ -697,7 +697,7 @@ 
 
 def _push(orig, ui, repo, dest=None, *args, **opts):
 
-    bookmark = opts.get('bookmark')
+    bookmark = opts.get(r'bookmark')
     # we only support pushing one infinitepush bookmark at once
     if len(bookmark) == 1:
         bookmark = bookmark[0]
@@ -718,7 +718,7 @@ 
         if scratchpush:
             # this is an infinitepush, we don't want the bookmark to be applied
             # rather that should be stored in the bundlestore
-            opts['bookmark'] = []
+            opts[r'bookmark'] = []
             ui.setconfig(experimental, configscratchpush, True)
             oldphasemove = extensions.wrapfunction(exchange,
                                                    '_localphasemove',
@@ -914,7 +914,7 @@ 
     fd, bundlefile = tempfile.mkstemp()
     try:
         try:
-            fp = os.fdopen(fd, 'wb')
+            fp = os.fdopen(fd, r'wb')
             fp.write(buf.read())
         finally:
             fp.close()
@@ -1000,7 +1000,7 @@ 
         fd, bundlefile = tempfile.mkstemp()
         try:
             try:
-                fp = os.fdopen(fd, 'wb')
+                fp = os.fdopen(fd, r'wb')
                 fp.write(buf.read())
             finally:
                 fp.close()
@@ -1112,7 +1112,7 @@ 
     fd, bundlefile = tempfile.mkstemp()
     try:
         try:
-            fp = os.fdopen(fd, 'wb')
+            fp = os.fdopen(fd, r'wb')
             fp.write(buf.read())
         finally:
             fp.close()