You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2016/04/30 12:34:27 UTC
svn commit: r1741740 - in /subversion/trunk: contrib/client-side/
contrib/client-side/svnmerge/ contrib/server-side/
subversion/tests/cmdline/ tools/dev/ tools/dev/benchmarks/RepoPerf/
Author: stefan2
Date: Sat Apr 30 10:34:27 2016
New Revision: 1741740
URL: http://svn.apache.org/viewvc?rev=1741740&view=rev
Log:
Work towards Python 3 compatibility. Since we already require Python 2.7+,
we can use the new syntax without further limiting our Python 2 support.
* contrib/client-side/incremental-update.py
* contrib/client-side/svn_export_empty_files.py
* contrib/client-side/svnmerge/svnmerge.py
* contrib/server-side/svn-tweak-author.py
* subversion/tests/cmdline/merge_automatic_tests.py
* tools/dev/benchmarks/RepoPerf/win_repo_bench.py
* tools/dev/merge-graph.py
(): Replace occurances of Python 2 print statements with continuation
comma by writes to stdout. Don't forget to explicitly add the space
character that print would have added one.
Modified:
subversion/trunk/contrib/client-side/incremental-update.py
subversion/trunk/contrib/client-side/svn_export_empty_files.py
subversion/trunk/contrib/client-side/svnmerge/svnmerge.py
subversion/trunk/contrib/server-side/svn-tweak-author.py
subversion/trunk/subversion/tests/cmdline/merge_automatic_tests.py
subversion/trunk/tools/dev/benchmarks/RepoPerf/win_repo_bench.py
subversion/trunk/tools/dev/merge-graph.py
Modified: subversion/trunk/contrib/client-side/incremental-update.py
URL: http://svn.apache.org/viewvc/subversion/trunk/contrib/client-side/incremental-update.py?rev=1741740&r1=1741739&r2=1741740&view=diff
==============================================================================
--- subversion/trunk/contrib/client-side/incremental-update.py (original)
+++ subversion/trunk/contrib/client-side/incremental-update.py Sat Apr 30 10:34:27 2016
@@ -156,11 +156,11 @@ def main():
usage_and_exit(None)
path = sys.argv[-1]
args = ' '.join(sys.argv[1:-1] + ['--non-interactive'])
- print "Fetch HEAD revision...",
+ sys.stdout.write("Fetch HEAD revision... ")
head_revision = get_head_revision(path, args)
print("done.")
print("Updating to revision %d" % (head_revision))
- print "Harvesting the list of subdirectories...",
+ sys.stdout.write("Harvesting the list of subdirectories... ")
dirs = harvest_dirs(path)
print("done.")
dirs.sort(compare_paths)
Modified: subversion/trunk/contrib/client-side/svn_export_empty_files.py
URL: http://svn.apache.org/viewvc/subversion/trunk/contrib/client-side/svn_export_empty_files.py?rev=1741740&r1=1741739&r2=1741740&view=diff
==============================================================================
--- subversion/trunk/contrib/client-side/svn_export_empty_files.py (original)
+++ subversion/trunk/contrib/client-side/svn_export_empty_files.py Sat Apr 30 10:34:27 2016
@@ -295,7 +295,7 @@ def main(ctx, url, export_pathname):
if ctx.delete_needed:
print("There are files and directories in the local filesystem")
print("that do not exist in the Subversion repository that were")
- print "not deleted. ",
+ sys.stdout.write("not deleted. ")
if ctx.delete_needed:
print("Please pass the --delete command line option")
print("to have this script delete those files and directories.")
Modified: subversion/trunk/contrib/client-side/svnmerge/svnmerge.py
URL: http://svn.apache.org/viewvc/subversion/trunk/contrib/client-side/svnmerge/svnmerge.py?rev=1741740&r1=1741739&r2=1741740&view=diff
==============================================================================
--- subversion/trunk/contrib/client-side/svnmerge/svnmerge.py (original)
+++ subversion/trunk/contrib/client-side/svnmerge/svnmerge.py Sat Apr 30 10:34:27 2016
@@ -1999,7 +1999,7 @@ class CommandOpts:
indent = max(map(len, cmds))
for c in cmds:
h = self.ctable[c].short_help()
- print " %-*s " % (indent, c),
+ sys.stdout.write(" %-*s " % (indent, c))
self._print_wrapped(h, indent+6)
def print_command_help(self, cmd):
cmd = self.ctable[str(cmd)]
@@ -2010,7 +2010,7 @@ class CommandOpts:
flags = [o.repr_flags() for o in opts]
indent = max(map(len, flags))
for f,o in zip(flags, opts):
- print " %-*s :" % (indent, f),
+ sys.stdout.write(" %-*s : " % (indent, f))
self._print_wrapped(o.help, indent+5)
print('\nCommand options:')
print_opts(cmd.opts)
Modified: subversion/trunk/contrib/server-side/svn-tweak-author.py
URL: http://svn.apache.org/viewvc/subversion/trunk/contrib/server-side/svn-tweak-author.py?rev=1741740&r1=1741739&r2=1741740&view=diff
==============================================================================
--- subversion/trunk/contrib/server-side/svn-tweak-author.py (original)
+++ subversion/trunk/contrib/server-side/svn-tweak-author.py Sat Apr 30 10:34:27 2016
@@ -67,9 +67,9 @@ def tweak_rev_author(fs_obj, revision, a
"""Change the value of the svn:author property for REVISION in
repository filesystem FS_OBJ in AUTHOR."""
if author is None:
- print "Deleting author for revision %d..." % (revision),
+ sys.stdout.write("Deleting author for revision %d... " % (revision))
else:
- print "Tweaking author for revision %d..." % (revision),
+ sys.stdout.write("Tweaking author for revision %d... " % (revision))
try:
fs.svn_fs_change_rev_prop(fs_obj, revision,
core.SVN_PROP_REVISION_AUTHOR, author)
Modified: subversion/trunk/subversion/tests/cmdline/merge_automatic_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/merge_automatic_tests.py?rev=1741740&r1=1741739&r2=1741740&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/merge_automatic_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/merge_automatic_tests.py Sat Apr 30 10:34:27 2016
@@ -213,7 +213,7 @@ def get_3ways_from_output(output):
merges = []
for line in output:
- print "## " + line,
+ sys.stdout.write("## " + line + " ")
# Extract "A1" from a line like "DBG: merge.c:11336: base svn://.../A@1"
match = re.search(r'merge\.c:.* base .* /(\w+)@([0-9-]+)', line)
if match:
Modified: subversion/trunk/tools/dev/benchmarks/RepoPerf/win_repo_bench.py
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dev/benchmarks/RepoPerf/win_repo_bench.py?rev=1741740&r1=1741739&r2=1741740&view=diff
==============================================================================
--- subversion/trunk/tools/dev/benchmarks/RepoPerf/win_repo_bench.py (original)
+++ subversion/trunk/tools/dev/benchmarks/RepoPerf/win_repo_bench.py Sat Apr 30 10:34:27 2016
@@ -115,7 +115,7 @@ def run_cs_command(state, config, reposi
# Display the operation
repo_title = repository.replace('nonpacked', 'nopack')
- print state, "\t", repo_title, "\t", prefix, "\t", config, "\t",
+ sys.stdout.write(state, "\t", repo_title, "\t", prefix, "\t", config, "\t ")
sys.stdout.flush()
# Execute the command and show the execution times
@@ -215,7 +215,7 @@ def run_admin_command(state, config, rep
else:
extra = []
- print state, "\t", repository, "\t", config, "\t",
+ sys.stdout.write(state, "\t", repository, "\t", config, "\t ")
sys.stdout.flush()
subprocess.call(["TimeWin.exe", exe] + args + extra)
Modified: subversion/trunk/tools/dev/merge-graph.py
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dev/merge-graph.py?rev=1741740&r1=1741739&r2=1741740&view=diff
==============================================================================
--- subversion/trunk/tools/dev/merge-graph.py (original)
+++ subversion/trunk/tools/dev/merge-graph.py Sat Apr 30 10:34:27 2016
@@ -49,10 +49,10 @@ if __name__ == '__main__':
formats.append('png')
for config_filename in args:
- print "%s: reading '%s'," % (prog_name, config_filename),
+ sys.stdout.write("%s: reading '%s', " % (prog_name, config_filename))
graph = MergeDot(config_filename, rankdir='LR', dpi='72')
for format in formats:
filename = '%s.%s' % (graph.basename, format)
- print "writing '%s'" % filename,
+ sys.stdout.write("writing '%s' " % filename)
graph.save(format=format, filename=filename)
print