D4687: py3: use print as a function in tests/test-revert.t

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Thu Sep 20 22:00:14 UTC 2018


pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This makes the test work on Python 3.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D4687

AFFECTED FILES
  contrib/python3-whitelist
  tests/test-revert.t

CHANGE DETAILS

diff --git a/tests/test-revert.t b/tests/test-revert.t
--- a/tests/test-revert.t
+++ b/tests/test-revert.t
@@ -532,14 +532,15 @@
 
   $ cat << EOF >> dircontent.py
   > # generate a simple text view of the directory for easy comparison
+  > from __future__ import print_function
   > import os
   > files = os.listdir('.')
   > files.sort()
   > for filename in files:
   >     if os.path.isdir(filename):
   >         continue
   >     content = open(filename).read()
-  >     print '%-6s %s' % (content.strip(), filename)
+  >     print('%-6s %s' % (content.strip(), filename))
   > EOF
 
 Generate appropriate repo state
diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -471,6 +471,7 @@
 test-revert-flags.t
 test-revert-interactive.t
 test-revert-unknown.t
+test-revert.t
 test-revisions.t
 test-revlog-ancestry.py
 test-revlog-group-emptyiter.t



To: pulkit, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list