# HG changeset patch # User Augie Fackler # Date 2018-10-23 15:31:33 # Node ID 005bc856e9192b2dad6b9d382af9fbd5ce0b6a9a # Parent 09a37a5d8f5d3a7e3e954eb954d83ad67a8b519a py3: port test-log-exthook.t to Python 3 For once an easy one. Differential Revision: https://phab.mercurial-scm.org/D5184 diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist --- a/contrib/python3-whitelist +++ b/contrib/python3-whitelist @@ -309,6 +309,7 @@ test-linelog.py test-linerange.py test-locate.t test-lock-badness.t +test-log-exthook.t test-log-linerange.t test-log.t test-logexchange.t diff --git a/tests/test-log-exthook.t b/tests/test-log-exthook.t --- a/tests/test-log-exthook.t +++ b/tests/test-log-exthook.t @@ -9,10 +9,12 @@ Test hg log changeset printer external h > 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