changeset 41372:40787a96fda7

py3: fix test-update-atomic.t The .replace('o', '') hack on oct() return value is required because: % python -c 'print(oct(10))' 012 % python3 -c 'print(oct(10))' 0o12 Differential Revision: https://phab.mercurial-scm.org/D5684
author Augie Fackler <augie@google.com>
date Thu, 24 Jan 2019 15:03:00 -0500
parents 9448b2e4c9fa
children 0ae3ddb4fbed
files contrib/python3-whitelist tests/test-update-atomic.t
diffstat 2 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/python3-whitelist	Thu Jan 24 15:02:28 2019 -0500
+++ b/contrib/python3-whitelist	Thu Jan 24 15:03:00 2019 -0500
@@ -690,6 +690,7 @@
 test-unionrepo.t
 test-unrelated-pull.t
 test-up-local-change.t
+test-update-atomic.t
 test-update-branches.t
 test-update-dest.t
 test-update-issue1456.t
--- a/tests/test-update-atomic.t	Thu Jan 24 15:02:28 2019 -0500
+++ b/tests/test-update-atomic.t	Thu Jan 24 15:03:00 2019 -0500
@@ -10,7 +10,7 @@
   > 
   > for file_path in sys.argv[1:]:
   >     file_stat = os.stat(file_path)
-  >     octal_mode = oct(file_stat[ST_MODE] & 0o777)
+  >     octal_mode = oct(file_stat[ST_MODE] & 0o777).replace('o', '')
   >     print("%s:%s" % (file_path, octal_mode))
   > 
   > EOF
@@ -19,11 +19,15 @@
   $ cd repo
 
   $ cat > .hg/showwrites.py <<EOF
+  > from __future__ import print_function
+  > from mercurial import pycompat
+  > from mercurial.utils import stringutil
   > def uisetup(ui):
   >   from mercurial import vfs
   >   class newvfs(vfs.vfs):
   >     def __call__(self, *args, **kwargs):
-  >       print('vfs open', args, sorted(list(kwargs.items())))
+  >       print(pycompat.sysstr(stringutil.pprint(
+  >           ('vfs open', args, sorted(list(kwargs.items()))))))
   >       return super(newvfs, self).__call__(*args, **kwargs)
   >   vfs.vfs = newvfs
   > EOF