Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 669911840A for ; Sat, 30 Apr 2016 09:48:20 +0000 (UTC) Received: (qmail 22441 invoked by uid 500); 30 Apr 2016 09:48:20 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 22399 invoked by uid 500); 30 Apr 2016 09:48:20 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 22388 invoked by uid 99); 30 Apr 2016 09:48:20 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 30 Apr 2016 09:48:20 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 9B88C1A06BC for ; Sat, 30 Apr 2016 09:48:19 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.799 X-Spam-Level: * X-Spam-Status: No, score=1.799 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id yXH7rYL7CZeX for ; Sat, 30 Apr 2016 09:48:17 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTP id E4ABB5F23C for ; Sat, 30 Apr 2016 09:48:16 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 4FC75E009C for ; Sat, 30 Apr 2016 09:48:15 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 3E0AF3A0216 for ; Sat, 30 Apr 2016 09:48:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1741735 - in /subversion/trunk: contrib/client-side/ contrib/client-side/svnmerge/ contrib/server-side/ contrib/server-side/fsfsfixer/fixer/ tools/dev/mergegraph/ Date: Sat, 30 Apr 2016 09:48:13 -0000 To: commits@subversion.apache.org From: stefan2@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160430094814.3E0AF3A0216@svn01-us-west.apache.org> Author: stefan2 Date: Sat Apr 30 09:48:13 2016 New Revision: 1741735 URL: http://svn.apache.org/viewvc?rev=1741735&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/svn_export_empty_files.py * contrib/client-side/svnmerge/svnmerge-migrate-history.py * contrib/client-side/svnmerge/svnmerge.py * contrib/client-side/svn-merge-vendor.py * contrib/server-side/add-needs-lock.py * contrib/server-side/fsfsfixer/fixer/find_good_id.py * contrib/server-side/fsfsverify.py * tools/dev/mergegraph/mergegraph.py (): Replace occurances of Python 2 print statements to std streams with calls to the Python 3 style print function. Don't forget to explicitly print a newline. Modified: subversion/trunk/contrib/client-side/svn-merge-vendor.py subversion/trunk/contrib/client-side/svn_export_empty_files.py subversion/trunk/contrib/client-side/svnmerge/svnmerge-migrate-history.py subversion/trunk/contrib/client-side/svnmerge/svnmerge.py subversion/trunk/contrib/server-side/add-needs-lock.py subversion/trunk/contrib/server-side/fsfsfixer/fixer/find_good_id.py subversion/trunk/contrib/server-side/fsfsverify.py subversion/trunk/tools/dev/mergegraph/mergegraph.py Modified: subversion/trunk/contrib/client-side/svn-merge-vendor.py URL: http://svn.apache.org/viewvc/subversion/trunk/contrib/client-side/svn-merge-vendor.py?rev=1741735&r1=1741734&r2=1741735&view=diff ============================================================================== --- subversion/trunk/contrib/client-side/svn-merge-vendor.py (original) +++ subversion/trunk/contrib/client-side/svn-merge-vendor.py Sat Apr 30 09:48:13 2016 @@ -336,7 +336,7 @@ def get_xml_text_content(xml_doc, xpath) def usage(error = None): """Print usage message and exit""" - print >>sys.stderr, """%s: Merges the difference between two revisions of the original repository of the vendor, to the vendor branch + sys.stderr.write("""%s: Merges the difference between two revisions of the original repository of the vendor, to the vendor branch usage: %s [options] REPO_URL CURRENT_PATH ORIGINAL_REPO_URL -r N:M - REPO_URL : repository URL for the vendor branch (i.e: http://svn.example.com/repos/vendor/libcomplex) @@ -369,10 +369,10 @@ Valid options: -v [--verbose] : verbose mode -c [--merged-vendor] arg : working copy path of the original already merged vendor trunk (skips the steps 1. and 2.) -w [--current-wc] arg : working copy path of the current checked out trunk of the vendor branch (skips the step 3.) - """ % ((prog_name,) * 2) + """ % ((prog_name,) * 2)) if error: - print >>sys.stder, "", "Current error : "+error + sys.stder.write("\nCurrent error : " + error + "\n") sys.exit(1) 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=1741735&r1=1741734&r2=1741735&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 09:48:13 2016 @@ -363,7 +363,7 @@ if __name__ == '__main__': except getopt.GetoptError: usage(False) if len(args) < 1 or len(args) > 2: - print >>sys.stderr, "Incorrect number of arguments" + sys.stderr.write("Incorrect number of arguments\n") usage(False) for o, a in opts: @@ -397,7 +397,7 @@ if __name__ == '__main__': try: last_slash_index = url.rindex('/') except ValueError: - print >>sys.stderr, "Cannot find a / in the URL '%s'" % url + sys.stderr.write("Cannot find a / in the URL '%s'\n" % url) usage(False) export_pathname = url[last_slash_index+1:] Modified: subversion/trunk/contrib/client-side/svnmerge/svnmerge-migrate-history.py URL: http://svn.apache.org/viewvc/subversion/trunk/contrib/client-side/svnmerge/svnmerge-migrate-history.py?rev=1741735&r1=1741734&r2=1741735&view=diff ============================================================================== --- subversion/trunk/contrib/client-side/svnmerge/svnmerge-migrate-history.py (original) +++ subversion/trunk/contrib/client-side/svnmerge/svnmerge-migrate-history.py Sat Apr 30 09:48:13 2016 @@ -67,8 +67,8 @@ def usage_and_exit(error_msg=None): stream = error_msg and sys.stderr or sys.stdout if error_msg: - print >> stream, "ERROR: %s\n" % error_msg - print >> stream, """Usage: %s REPOS_PATH [PATH_PREFIX...] [OPTIONS] + stream.write("ERROR: %s\n\n" % error_msg) + stream.write("""Usage: %s REPOS_PATH [PATH_PREFIX...] [OPTIONS] %s --help Migrate merge history from svnmerge.py's format to Subversion 1.5's @@ -88,7 +88,7 @@ Options: Example: %s /path/to/repos trunk branches tags -""" % (progname, progname, progname) +""" % (progname, progname, progname)) sys.exit(error_msg and 1 or 0) class Migrator: Modified: subversion/trunk/contrib/client-side/svnmerge/svnmerge.py URL: http://svn.apache.org/viewvc/subversion/trunk/contrib/client-side/svnmerge/svnmerge.py?rev=1741735&r1=1741734&r2=1741735&view=diff ============================================================================== --- subversion/trunk/contrib/client-side/svnmerge/svnmerge.py (original) +++ subversion/trunk/contrib/client-side/svnmerge/svnmerge.py Sat Apr 30 09:48:13 2016 @@ -206,7 +206,7 @@ def console_width(): def error(s): """Subroutine to output an error and bail.""" - print >> sys.stderr, "%s: %s" % (NAME, s) + sys.stderr.write("%s: %s\n" % (NAME, s)) sys.exit(1) def report(s): @@ -1981,7 +1981,7 @@ class CommandOpts: return cmd, args, state def error(self, s, cmd=None): - print >>sys.stderr, "%s: %s" % (self.progname, s) + sys.stderr.write("%s: %s\n" % (self.progname, s)) if cmd is not None: self.print_command_help(cmd) else: Modified: subversion/trunk/contrib/server-side/add-needs-lock.py URL: http://svn.apache.org/viewvc/subversion/trunk/contrib/server-side/add-needs-lock.py?rev=1741735&r1=1741734&r2=1741735&view=diff ============================================================================== --- subversion/trunk/contrib/server-side/add-needs-lock.py (original) +++ subversion/trunk/contrib/server-side/add-needs-lock.py Sat Apr 30 09:48:13 2016 @@ -47,7 +47,7 @@ try: import svn.fs import svn.repos except ImportError as e: - print >> sys.stderr, "ERROR: Unable to import Subversion's Python bindings: '%s'" % e + sys.stderr.write("ERROR: Unable to import Subversion's Python bindings: '%s'\n" % e) sys.exit(1) # Walk a tree returning file paths Modified: subversion/trunk/contrib/server-side/fsfsfixer/fixer/find_good_id.py URL: http://svn.apache.org/viewvc/subversion/trunk/contrib/server-side/fsfsfixer/fixer/find_good_id.py?rev=1741735&r1=1741734&r2=1741735&view=diff ============================================================================== --- subversion/trunk/contrib/server-side/fsfsfixer/fixer/find_good_id.py (original) +++ subversion/trunk/contrib/server-side/fsfsfixer/fixer/find_good_id.py Sat Apr 30 09:48:13 2016 @@ -117,7 +117,7 @@ if __name__ == '__main__': # reconstruct the file so as to preserve all offsets. # ### TODO: This check should be in the caller rather than here. if len(good_id) != len(bad_id): - print >>sys.stderr, "warning: the good ID has a different length: " + \ - "bad id '" + bad_id + "', good id '" + good_id + "'" + sys.stderr.write("warning: the good ID has a different length: " + \ + "bad id '" + bad_id + "', good id '" + good_id + "'\n") print good_id Modified: subversion/trunk/contrib/server-side/fsfsverify.py URL: http://svn.apache.org/viewvc/subversion/trunk/contrib/server-side/fsfsverify.py?rev=1741735&r1=1741734&r2=1741735&view=diff ============================================================================== --- subversion/trunk/contrib/server-side/fsfsverify.py (original) +++ subversion/trunk/contrib/server-side/fsfsverify.py Sat Apr 30 09:48:13 2016 @@ -561,7 +561,7 @@ class Rep(object): raise e if self.rev != currentRev: - print >>sys.stderr, "Skipping text rep since it isn't present in the current rev" + sys.stderr.write("Skipping text rep since it isn't present in the current rev\n") return f.seek(self.offset) @@ -1078,16 +1078,16 @@ def checkOptions(options): count = count + 1 if count > 1: - print >>sys.stderr, "Please use only one of -c, -f, and -t." + sys.stderr.write("Please use only one of -c, -f, and -t.\n") sys.exit(1) if options.dumpChanged and (options.dumpWindows or options.dumpInstructions): - print >>sys.stderr, \ - "-c is incompatible with -w and -i. Dropping -w and/or -i." + sys.stderr.write(\ + "-c is incompatible with -w and -i. Dropping -w and/or -i.\n") if options.noVerify and (options.dumpWindows or options.dumpInstructions): - print >>sys.stderr, \ - "--no-verify is incompatible with -w and -i. Dropping -w and/or -i." + sys.stderr.write(\ + "--no-verify is incompatible with -w and -i. Dropping -w and/or -i.\n") def handleError(error, withTraceback=False): @@ -1096,8 +1096,8 @@ def handleError(error, withTraceback=Fal import traceback traceback.print_exc() - print >>sys.stderr,"Error %s: %s" % (error.__class__.__name__, str(e)) - print >>sys.stderr,"Try running with -f to fix the revision" + sys.stderr.write("Error %s: %s\n" % (error.__class__.__name__, str(e))) + sys.stderr.write("Try running with -f to fix the revision\n") sys.exit(1) Modified: subversion/trunk/tools/dev/mergegraph/mergegraph.py URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dev/mergegraph/mergegraph.py?rev=1741735&r1=1741734&r2=1741735&view=diff ============================================================================== --- subversion/trunk/tools/dev/mergegraph/mergegraph.py (original) +++ subversion/trunk/tools/dev/mergegraph/mergegraph.py Sat Apr 30 09:48:13 2016 @@ -242,7 +242,7 @@ class MergeDot(MergeGraph, pydot.Dot): 'annotations': '[]' }) files_read = config.read(config_filename) if len(files_read) == 0: - print >> sys.stderr, 'graph: unable to read graph config from "' + config_filename + '"' + sys.stderr.write('graph: unable to read graph config from "' + config_filename + '"\n') sys.exit(1) graph.basename = config.get('graph', 'basename') graph.title = config.get('graph', 'title')