[PATCH 3 of 5] tests: use print_function in test-revlog-ancestry.py

Robert Stanca robert.stanca7 at gmail.com
Sun Apr 3 22:39:32 EDT 2016


# HG changeset patch
# User Robert Stanca <robert.stanca7 at gmail.com>
# Date 1459735811 -10800
#      Mon Apr 04 05:10:11 2016 +0300
# Node ID c898e428dbd2f4b39b7182efb9601ed2ddef9cd0
# Parent  ff22ec9c74e19dd2670b87203342bcee7b6d3456
tests: use print_function in test-revlog-ancestry.py

diff -r ff22ec9c74e1 -r c898e428dbd2 tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t	Mon Apr 04 05:09:24 2016 +0300
+++ b/tests/test-check-py3-compat.t	Mon Apr 04 05:10:11 2016 +0300
@@ -62,7 +62,6 @@
   tests/test-manifest.py not using absolute_import
   tests/test-pathencode.py not using absolute_import
   tests/test-pathencode.py requires print_function
-  tests/test-revlog-ancestry.py requires print_function
   tests/test-run-tests.py not using absolute_import
   tests/test-simplemerge.py not using absolute_import
   tests/test-status-inprocess.py not using absolute_import
@@ -205,7 +204,6 @@
   tests/readlink.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
   tests/test-demandimport.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
   tests/test-lrucachedict.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
-  tests/test-revlog-ancestry.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
   tests/test-status-inprocess.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
   tests/test-trusted.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
 #endif
diff -r ff22ec9c74e1 -r c898e428dbd2 tests/test-revlog-ancestry.py
--- a/tests/test-revlog-ancestry.py	Mon Apr 04 05:09:24 2016 +0300
+++ b/tests/test-revlog-ancestry.py	Mon Apr 04 05:10:11 2016 +0300
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+from __future__ import absolute_import, print_function
 import os
 from mercurial import (
     hg,
@@ -51,39 +51,38 @@
     addcommit("I", 8)
 
     # Ancestors
-    print 'Ancestors of 5'
+    print('Ancestors of 5')
     for r in repo.changelog.ancestors([5]):
-        print r,
+        print(r, end=' ')
 
-    print '\nAncestors of 6 and 5'
+    print('\nAncestors of 6 and 5')
     for r in repo.changelog.ancestors([6, 5]):
-        print r,
+        print(r, end=' ')
 
-    print '\nAncestors of 5 and 4'
+    print('\nAncestors of 5 and 4')
     for r in repo.changelog.ancestors([5, 4]):
-        print r,
+        print(r, end=' ')
 
-    print '\nAncestors of 7, stop at 6'
+    print('\nAncestors of 7, stop at 6')
     for r in repo.changelog.ancestors([7], 6):
-        print r,
+        print(r, end=' ')
 
-    print '\nAncestors of 7, including revs'
+    print('\nAncestors of 7, including revs')
     for r in repo.changelog.ancestors([7], inclusive=True):
-        print r,
+        print(r, end=' ')
 
-    print '\nAncestors of 7, 5 and 3, including revs'
+    print('\nAncestors of 7, 5 and 3, including revs')
     for r in repo.changelog.ancestors([7, 5, 3], inclusive=True):
-        print r,
+        print(r, end=' ')
 
     # Descendants
-    print '\n\nDescendants of 5'
+    print('\n\nDescendants of 5')
     for r in repo.changelog.descendants([5]):
-        print r,
+        print(r, end=' ')
 
-    print '\nDescendants of 5 and 3'
+    print('\nDescendants of 5 and 3')
     for r in repo.changelog.descendants([5, 3]):
-        print r,
+        print(r, end=' ')
 
-    print '\nDescendants of 5 and 4'
-    for r in repo.changelog.descendants([5, 4]):
-        print r,
+    print('\nDescendants of 5 and 4')
+    print(*repo.changelog.descendants([5, 4]), sep=' ')


More information about the Mercurial-devel mailing list