<div dir="ltr"># HG changeset patch<br># User Robert Stanca <<a href="mailto:robert.stanca7@gmail.com">robert.stanca7@gmail.com</a>><br># Date 1458905221 -7200<br>#      Fri Mar 25 13:27:01 2016 +0200<br># Node ID 335fd37954517b9c1ffce5eb60ec945d5fc99505<br># Parent  916d835bb60d537d47ebc6fb24b7abc20a628d42<br>multiple: use absolute_import , print_function<br><br>diff -r 916d835bb60d -r 335fd3795451 tests/test-check-py3-compat.t<br>--- a/tests/test-check-py3-compat.t    Fri Mar 25 13:15:36 2016 +0200<br>+++ b/tests/test-check-py3-compat.t    Fri Mar 25 13:27:01 2016 +0200<br>@@ -53,12 +53,6 @@<br>   tests/svnxml.py not using absolute_import<br>   tests/test-atomictempfile.py not using absolute_import<br>   tests/test-doctest.py not using absolute_import<br>-  tests/test-duplicateoptions.py not using absolute_import<br>-  tests/test-duplicateoptions.py requires print_function<br>-  tests/test-filecache.py not using absolute_import<br>-  tests/test-filecache.py requires print_function<br>-  tests/test-filelog.py not using absolute_import<br>-  tests/test-filelog.py requires print_function<br>   tests/test-hg-parseurl.py not using absolute_import<br>   tests/test-hg-parseurl.py requires print_function<br>   tests/test-hgweb-auth.py not using absolute_import<br>diff -r 916d835bb60d -r 335fd3795451 tests/test-duplicateoptions.py<br>--- a/tests/test-duplicateoptions.py    Fri Mar 25 13:15:36 2016 +0200<br>+++ b/tests/test-duplicateoptions.py    Fri Mar 25 13:27:01 2016 +0200<br>@@ -1,5 +1,10 @@<br>+from __future__ import absolute_import, print_function<br> import os<br>-from mercurial import ui, commands, extensions<br>+from mercurial import (<br>+    ui,<br>+    commands,<br>+    extensions,<br>+)<br> <br> ignore = set(['highlight', 'win32text', 'factotum'])<br> <br>@@ -31,6 +36,6 @@<br>     for option in entry[1]:<br>         if (option[0] and option[0] in seenshort) or \<br>            (option[1] and option[1] in seenlong):<br>-            print "command '" + cmd + "' has duplicate option " + str(option)<br>+            print ("command '" + cmd + "' has duplicate option " + str(option))<br>         seenshort.add(option[0])<br>         seenlong.add(option[1])<br>diff -r 916d835bb60d -r 335fd3795451 tests/test-filecache.py<br>--- a/tests/test-filecache.py    Fri Mar 25 13:15:36 2016 +0200<br>+++ b/tests/test-filecache.py    Fri Mar 25 13:27:01 2016 +0200<br>@@ -1,10 +1,19 @@<br>-import sys, os, subprocess<br>+from __future__ import absolute_import, print_function<br>+import os<br>+import subprocess<br>+import sys<br> <br> if subprocess.call(['python', '%s/hghave' % os.environ['TESTDIR'],<br>                     'cacheable']):<br>     sys.exit(80)<br> <br>-from mercurial import util, scmutil, extensions, hg, ui<br>+from mercurial import (<br>+    util,<br>+    scmutil,<br>+    extensions,<br>+    hg,<br>+    ui,<br>+)<br> <br> filecache = scmutil.filecache<br> <br>@@ -20,7 +29,7 @@<br> <br>     @filecache('x', 'y')<br>     def cached(self):<br>-        print 'creating'<br>+        print ('creating')<br>         return 'string from function'<br> <br>     def invalidate(self):<br>@@ -31,12 +40,12 @@<br>                 pass<br> <br> def basic(repo):<br>-    print "* neither file exists"<br>+    print ("* neither file exists")<br>     # calls function<br>     repo.cached<br> <br>     repo.invalidate()<br>-    print "* neither file still exists"<br>+    print ("* neither file still exists")<br>     # uses cache<br>     repo.cached<br> <br>@@ -44,7 +53,7 @@<br>     f = open('x', 'w')<br>     f.close()<br>     repo.invalidate()<br>-    print "* empty file x created"<br>+    print ("* empty file x created")<br>     # should recreate the object<br>     repo.cached<br> <br>@@ -52,12 +61,12 @@<br>     f.write('a')<br>     f.close()<br>     repo.invalidate()<br>-    print "* file x changed size"<br>+    print ("* file x changed size")<br>     # should recreate the object<br>     repo.cached<br> <br>     repo.invalidate()<br>-    print "* nothing changed with either file"<br>+    print ("* nothing changed with either file")<br>     # stats file again, reuses object<br>     repo.cached<br> <br>@@ -69,14 +78,14 @@<br>     f.close()<br> <br>     repo.invalidate()<br>-    print "* file x changed inode"<br>+    print ("* file x changed inode")<br>     repo.cached<br> <br>     # create empty file y<br>     f = open('y', 'w')<br>     f.close()<br>     repo.invalidate()<br>-    print "* empty file y created"<br>+    print ("* empty file y created")<br>     # should recreate the object<br>     repo.cached<br> <br>@@ -84,7 +93,7 @@<br>     f.write('A')<br>     f.close()<br>     repo.invalidate()<br>-    print "* file y changed size"<br>+    print ("* file y changed size")<br>     # should recreate the object<br>     repo.cached<br> <br>@@ -93,7 +102,7 @@<br>     f.close()<br> <br>     repo.invalidate()<br>-    print "* file y changed inode"<br>+    print ("* file y changed inode")<br>     repo.cached<br> <br>     f = scmutil.opener('.')('x', 'w', atomictemp=True)<br>@@ -104,7 +113,7 @@<br>     f.close()<br> <br>     repo.invalidate()<br>-    print "* both files changed inode"<br>+    print ("* both files changed inode")<br>     repo.cached<br> <br> def fakeuncacheable():<br>@@ -149,36 +158,36 @@<br>     os.remove('y')<br>     repo.cached = 'string set externally'<br>     repo.invalidate()<br>-    print "* neither file exists"<br>-    print repo.cached<br>+    print ("* neither file exists")<br>+    print (repo.cached)<br>     repo.invalidate()<br>     f = open('x', 'w')<br>     f.write('a')<br>     f.close()<br>-    print "* file x created"<br>-    print repo.cached<br>+    print ("* file x created")<br>+    print (repo.cached)<br> <br>     repo.cached = 'string 2 set externally'<br>     repo.invalidate()<br>-    print "* string set externally again"<br>-    print repo.cached<br>+    print ("* string set externally again")<br>+    print (repo.cached)<br> <br>     repo.invalidate()<br>     f = open('y', 'w')<br>     f.write('b')<br>     f.close()<br>-    print "* file y created"<br>-    print repo.cached<br>+    print ("* file y created")<br>+    print (repo.cached)<br> <br>-print 'basic:'<br>-print<br>+print ('basic:')<br>+print ()<br> basic(fakerepo())<br>-print<br>-print 'fakeuncacheable:'<br>-print<br>+print ()<br>+print ('fakeuncacheable:')<br>+print ()<br> fakeuncacheable()<br> test_filecache_synced()<br>-print<br>-print 'setbeforeget:'<br>-print<br>+print ()<br>+print ('setbeforeget:')<br>+print ()<br> setbeforeget(fakerepo())<br>diff -r 916d835bb60d -r 335fd3795451 tests/test-filelog.py<br>--- a/tests/test-filelog.py    Fri Mar 25 13:15:36 2016 +0200<br>+++ b/tests/test-filelog.py    Fri Mar 25 13:27:01 2016 +0200<br>@@ -2,8 +2,15 @@<br> """<br> Tests the behavior of filelog w.r.t. data starting with '\1\n'<br> """<br>-from mercurial import ui, hg<br>-from mercurial.node import nullid, hex<br>+from __future__ import absolute_import, print_function<br>+from mercurial import (<br>+    ui,<br>+    hg,<br>+)<br>+from mercurial.node import (<br>+    nullid,<br>+    hex,<br>+)<br> <br> myui = ui.ui()<br> repo = hg.repository(myui, path='.', create=True)<br>@@ -30,7 +37,7 @@<br>             lock.release()<br> <br> def error(text):<br>-    print 'ERROR: ' + text<br>+    print ('ERROR: ' + text)<br> <br> textwith = '\1\nfoo'<br> without = 'foo'<br>@@ -52,4 +59,4 @@<br> if fl.size(1) != len(textwith):<br>     error('filelog.size for a renaming + data starting with \\1\\n')<br> <br>-print 'OK.'<br>+print ('OK.')<br></div>