py3: port test-log-exthook.t to Python 3
authorAugie Fackler <augie@google.com>
Tue, 23 Oct 2018 11:31:33 -0400
changeset 40441 005bc856e919
parent 40440 09a37a5d8f5d
child 40442 d69cf134bd50
py3: port test-log-exthook.t to Python 3 For once an easy one. Differential Revision: https://phab.mercurial-scm.org/D5184
contrib/python3-whitelist
tests/test-log-exthook.t
--- a/contrib/python3-whitelist	Fri Oct 12 12:30:47 2018 -0400
+++ b/contrib/python3-whitelist	Tue Oct 23 11:31:33 2018 -0400
@@ -309,6 +309,7 @@
 test-linerange.py
 test-locate.t
 test-lock-badness.t
+test-log-exthook.t
 test-log-linerange.t
 test-log.t
 test-logexchange.t
--- a/tests/test-log-exthook.t	Fri Oct 12 12:30:47 2018 -0400
+++ b/tests/test-log-exthook.t	Tue Oct 23 11:31:33 2018 -0400
@@ -9,10 +9,12 @@
   >   logcmdutil,
   >   repair,
   > )
+  > def brot13(b):
+  >     return codecs.encode(b.decode('utf8'), 'rot-13').encode('utf8')
   > def rot13description(self, ctx):
-  >     summary = codecs.encode("summary", 'rot-13')
-  >     description = ctx.description().strip().splitlines()[0].encode('rot13')
-  >     self.ui.write("%s:     %s\n" % (summary, description))
+  >     description = ctx.description().strip().splitlines()[0]
+  >     self.ui.write(b"%s:     %s\n" % (brot13(b"summary"),
+  >                                      brot13(description)))
   > def reposetup(ui, repo):
   >     logcmdutil.changesetprinter._exthook = rot13description
   > EOF