# HG changeset patch # User Pulkit Goyal # Date 1537108081 -19800 # Node ID 2b9f315a4217d1f7565dda8676e5a4fce61a1b60 # Parent e3768bd48e26de35281fce4ee0fc1a27ef0375cf py3: use codecs.encode() to encode in rot-13 encoding The other occurence will need some more love as description is bytes by default and we need to decode it and then encode it. Differential Revision: https://phab.mercurial-scm.org/D4608 diff -r e3768bd48e26 -r 2b9f315a4217 tests/test-log-exthook.t --- a/tests/test-log-exthook.t Sun Sep 16 19:18:15 2018 +0530 +++ b/tests/test-log-exthook.t Sun Sep 16 19:58:01 2018 +0530 @@ -3,13 +3,14 @@ $ cat > $TESTTMP/logexthook.py < from __future__ import absolute_import + > import codecs > from mercurial import ( > commands, > logcmdutil, > repair, > ) > def rot13description(self, ctx): - > summary = "summary".encode('rot13') + > summary = codecs.encode("summary", 'rot-13') > description = ctx.description().strip().splitlines()[0].encode('rot13') > self.ui.write("%s: %s\n" % (summary, description)) > def reposetup(ui, repo):