D5768: subrepo: bytes/str cleanups on Git support

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Thu Jan 31 00:31:02 UTC 2019


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

REVISION SUMMARY
  Git subrepo tests now pass on Python 3.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  contrib/python3-whitelist
  mercurial/subrepo.py

CHANGE DETAILS

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -1286,7 +1286,7 @@
         if stream:
             return p.stdout, None
 
-        retdata = p.stdout.read().strip()
+        retdata = pycompat.fsencode(p.stdout.read().strip())
         # wait for the child to exit to avoid race condition.
         p.wait()
 
@@ -1662,13 +1662,14 @@
         for info in tar:
             if info.isdir():
                 continue
-            if match and not match(info.name):
+            bname = pycompat.fsencode(info.name)
+            if match and not match(bname):
                 continue
             if info.issym():
                 data = info.linkname
             else:
                 data = tar.extractfile(info).read()
-            archiver.addfile(prefix + self._path + '/' + info.name,
+            archiver.addfile(prefix + self._path + '/' + bname,
                              info.mode, info.issym(), data)
             total += 1
             progress.increment()
diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -679,6 +679,7 @@
 test-strip-cross.t
 test-strip.t
 test-subrepo-deep-nested-change.t
+test-subrepo-git.t
 test-subrepo-missing.t
 test-subrepo-paths.t
 test-subrepo-recursion.t



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


More information about the Mercurial-devel mailing list