[PATCH 05 of 10 V3] tests: use print_function in generate-working-copy-states.py

Robert Stanca robert.stanca7 at gmail.com
Sat Apr 2 11:37:37 EDT 2016


# HG changeset patch
# User Robert Stanca <robert.stanca7 at gmail.com>
# Date 1459607819 -10800
#      Sat Apr 02 17:36:59 2016 +0300
# Node ID 46616de055613731c804b467971f04496b6014db
# Parent  f0b365324407607f03e5367ecc706cf56284d031
tests: use print_function in generate-working-copy-states.py

diff -r f0b365324407 -r 46616de05561 tests/generate-working-copy-states.py
--- a/tests/generate-working-copy-states.py	Sat Apr 02 17:35:02 2016 +0300
+++ b/tests/generate-working-copy-states.py	Sat Apr 02 17:36:59 2016 +0300
@@ -29,7 +29,7 @@
 # $ hg forget *_*_*-untracked
 # $ rm *_*_missing-*
 
-from __future__ import absolute_import
+from __future__ import absolute_import, print_function
 
 import os
 import sys
@@ -66,7 +66,7 @@
 content = []
 for filename, states in combinations:
     if target == 'filelist':
-        print filename
+        print(filename)
     elif target == 'state':
         if depth == 'wc':
             # Make sure there is content so the file gets written and can be
@@ -75,7 +75,7 @@
         else:
             content.append((filename, states[int(depth) - 1]))
     else:
-        print >> sys.stderr, "unknown target:", target
+        print("unknown target:", target, file=sys.stderr)
         sys.exit(1)
 
 # write actual content
diff -r f0b365324407 -r 46616de05561 tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t	Sat Apr 02 17:35:02 2016 +0300
+++ b/tests/test-check-py3-compat.t	Sat Apr 02 17:36:59 2016 +0300
@@ -42,7 +42,6 @@
   i18n/check-translation.py not using absolute_import
   i18n/polib.py not using absolute_import
   setup.py not using absolute_import
-  tests/generate-working-copy-states.py requires print_function
   tests/get-with-headers.py requires print_function
   tests/heredoctest.py requires print_function
   tests/hypothesishelpers.py not using absolute_import
@@ -269,7 +268,6 @@
   mercurial/win32.py: error importing module: <ImportError> No module named 'msvcrt' (line 12)
   mercurial/windows.py: error importing module: <ImportError> No module named '_winreg' (line 10)
   mercurial/wireproto.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob)
-  tests/generate-working-copy-states.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
   tests/get-with-headers.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
   tests/readlink.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
   tests/silenttestrunner.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)


More information about the Mercurial-devel mailing list