py3: fix test-revlog.t
authorMark Thomas <mbthomas@fb.com>
Sun, 14 Oct 2018 09:07:43 +0000
changeset 40281 29b0e9cd02f4
parent 40280 170cd2a5a1da
child 40282 e4f82db071a4
py3: fix test-revlog.t The mpatchError has a trailing comma on Python 2 but not on Python 3, so use a glob to handle both Python 2 and Python 3. Differential Revision: https://phab.mercurial-scm.org/D5093
contrib/python3-whitelist
tests/test-revlog.t
--- a/contrib/python3-whitelist	Sun Oct 14 04:11:35 2018 -0400
+++ b/contrib/python3-whitelist	Sun Oct 14 09:07:43 2018 +0000
@@ -524,6 +524,7 @@
 test-revlog-packentry.t
 test-revlog-raw.py
 test-revlog-v2.t
+test-revlog.t
 test-revset-dirstate-parents.t
 test-revset-legacy-lookup.t
 test-revset-outgoing.t
--- a/tests/test-revlog.t	Sun Oct 14 04:11:35 2018 -0400
+++ b/tests/test-revlog.t	Sun Oct 14 09:07:43 2018 +0000
@@ -34,10 +34,11 @@
 
   $ hg init
 
-  >>> open("a.i", "wb").write(
+  >>> import codecs
+  >>> open("a.i", "wb").write(codecs.decode(codecs.decode(
   ... b"""eJxjYGZgZIAAYQYGxhgom+k/FMx8YKx9ZUaKSOyqo4cnuKb8mbqHV5cBCVTMWb1Cwqkhe4Gsg9AD
-  ... Joa3dYtcYYYBAQ8Qr4OqZAYRICPTSr5WKd/42rV36d+8/VmrNpv7NP1jQAXrQE4BqQUARngwVA=="""
-  ... .decode("base64").decode("zlib")) and None
+  ... Joa3dYtcYYYBAQ8Qr4OqZAYRICPTSr5WKd/42rV36d+8/VmrNpv7NP1jQAXrQE4BqQUARngwVA==""",
+  ... "base64"), "zlib")) and None
 
   $ hg debugrevlogindex a.i
      rev linkrev nodeid       p1           p2
@@ -49,4 +50,4 @@
   >>> tvfs.options = {b'revlogv1': True}
   >>> rl = revlog.revlog(tvfs, b'a.i')
   >>> rl.revision(1)
-  mpatchError('patch cannot be decoded',)
+  mpatchError(*'patch cannot be decoded'*) (glob)