changeset 36301:be5a6fe3643a

py3: make test-extdiff.t pass on Python 3
author Yuya Nishihara <yuya@tcha.org>
date Sat, 17 Feb 2018 18:20:15 +0900
parents 08f061a48a8f
children 4088e568a411
files contrib/python3-whitelist hgext/extdiff.py tests/test-extdiff.t
diffstat 3 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/python3-whitelist	Sat Feb 17 18:15:37 2018 +0900
+++ b/contrib/python3-whitelist	Sat Feb 17 18:20:15 2018 +0900
@@ -88,6 +88,7 @@
 test-exchange-obsmarkers-case-D3.t
 test-exchange-obsmarkers-case-D4.t
 test-execute-bit.t
+test-extdiff.t
 test-extra-filelog-entry.t
 test-filebranch.t
 test-flags.t
--- a/hgext/extdiff.py	Sat Feb 17 18:15:37 2018 +0900
+++ b/hgext/extdiff.py	Sat Feb 17 18:20:15 2018 +0900
@@ -285,7 +285,7 @@
             cmdline += ' $parent1 $child'
         cmdline = re.sub(regex, quote, cmdline)
 
-        ui.debug('running %r in %s\n' % (cmdline, tmproot))
+        ui.debug('running %r in %s\n' % (pycompat.bytestr(cmdline), tmproot))
         ui.system(cmdline, cwd=tmproot, blockedtag='extdiff')
 
         for copy_fn, working_fn, st in fnsandstat:
--- a/tests/test-extdiff.t	Sat Feb 17 18:15:37 2018 +0900
+++ b/tests/test-extdiff.t	Sat Feb 17 18:20:15 2018 +0900
@@ -424,7 +424,8 @@
 
 Test handling of non-ASCII paths in generated docstrings (issue5301)
 
-  >>> open("u", "w").write("\xa5\xa5")
+  >>> with open("u", "wb") as f:
+  ...     n = f.write(b"\xa5\xa5")
   $ U=`cat u`
 
   $ HGPLAIN=1 hg --config hgext.extdiff= --config extdiff.cmd.td=hi help -k xyzzy