Patchwork D9987: tests: fix differing output between py2 and py3

login
register
mail settings
Submitter phabricator
Date Feb. 12, 2021, 11:57 a.m.
Message ID <differential-rev-PHID-DREV-wg4xva4zdtdlryzpqoeo-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48302/
State Superseded
Headers show

Comments

phabricator - Feb. 12, 2021, 11:57 a.m.
Alphare created this revision.
Herald added a reviewer: durin42.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  db9e33beb0fb <https://phab.mercurial-scm.org/rHGdb9e33beb0fbc8a481a90f71dac68705091eaeac> broke the tests because of the difference in bytestring repr
  between py2 and py3. Rather than backout that change for so little, I figured
  I'd fix it myself.
  Hopefully Python 2 supports gets dropped very soon.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/changegroup.py
  tests/test-narrow-pull.t

CHANGE DETAILS




To: Alphare, durin42, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-narrow-pull.t b/tests/test-narrow-pull.t
--- a/tests/test-narrow-pull.t
+++ b/tests/test-narrow-pull.t
@@ -147,7 +147,7 @@ 
   $ hg clone -q --narrow ssh://user@dummy/master narrow2 --include "f1" -r 0
   $ cd narrow2
   $ hg pull -q -r 1
-  remote: abort: unexpected error: unable to resolve parent while packing b'00manifest.i' 1 for changeset 0
+  remote: abort: unexpected error: unable to resolve parent while packing '00manifest.i' 1 for changeset 0
   transaction abort!
   rollback completed
   abort: pull failed on remote
diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -685,7 +685,7 @@ 
                 # We failed to resolve a parent for this node, so
                 # we crash the changegroup construction.
                 raise error.Abort(
-                    b'unable to resolve parent while packing %r %r'
+                    b"unable to resolve parent while packing '%s' %r"
                     b' for changeset %r' % (store.indexfile, rev, clrev)
                 )