changeset 28764:e677b8daeb3f

py3: use print_function in test-revlog-ancestry.py
author Robert Stanca <robert.stanca7@gmail.com>
date Mon, 04 Apr 2016 05:10:11 +0300
parents abe605bbf0de
children 7779f9dfd938
files tests/test-check-py3-compat.t tests/test-revlog-ancestry.py
diffstat 2 files changed, 19 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- 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
@@ -230,7 +229,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)
 
--- 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=' ')