You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2012/05/10 01:21:09 UTC

svn commit: r1336448 - /subversion/trunk/tools/dist/release.py

Author: philip
Date: Wed May  9 23:21:09 2012
New Revision: 1336448

URL: http://svn.apache.org/viewvc?rev=1336448&view=rev
Log:
* tools/dist/release.py
  (secure_repos): New constant.
  (roll_tarballs): Do Unix last.
  (create_tag): New.
  (main): Add create-tag subcommand.

Modified:
    subversion/trunk/tools/dist/release.py

Modified: subversion/trunk/tools/dist/release.py
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dist/release.py?rev=1336448&r1=1336447&r2=1336448&view=diff
==============================================================================
--- subversion/trunk/tools/dist/release.py (original)
+++ subversion/trunk/tools/dist/release.py Wed May  9 23:21:09 2012
@@ -85,6 +85,7 @@ tool_versions = {
 
 # Some constants
 repos = 'http://svn.apache.org/repos/asf/subversion'
+secure_repos = 'https://svn.apache.org/repos/asf/subversion'
 dist_repos = 'https://dist.apache.org/repos/dist'
 dist_dev_url = dist_repos + '/dev/subversion'
 dist_release_url = dist_repos + '/release/subversion'
@@ -417,14 +418,15 @@ def roll_tarballs(args):
             extra_args = '-nightly'
         else:
             extra_args = '-%s %d' % (args.version.pre, args.version.pre_num)
-    logging.info('Building UNIX tarballs')
-    run_script(args.verbose, '%s/dist.sh -v %s -pr %s -r %d %s'
-                     % (sys.path[0], args.version.base, branch, args.revnum,
-                        extra_args) )
+    # Build Unix last to leave Unix-style svn_version.h for tagging
     logging.info('Buildling Windows tarballs')
     run_script(args.verbose, '%s/dist.sh -v %s -pr %s -r %d -zip %s'
                      % (sys.path[0], args.version.base, branch, args.revnum,
                         extra_args) )
+    logging.info('Building UNIX tarballs')
+    run_script(args.verbose, '%s/dist.sh -v %s -pr %s -r %d %s'
+                     % (sys.path[0], args.version.base, branch, args.revnum,
+                        extra_args) )
 
     # Move the results to the deploy directory
     logging.info('Moving artifacts and calculating checksums')
@@ -490,6 +492,32 @@ def post_candidates(args):
     proc.wait()
 
 #----------------------------------------------------------------------
+# Create tag
+
+def create_tag(args):
+    'Create tag in the repository'
+
+    if args.branch:
+        branch = secure_repos + '/' + args.branch
+    else:
+        branch = secure_repos + '/branches/%d.%d.x' % (args.version.major,
+                                                       args.version.minor)
+
+    tag = secure_repos + '/tags/' + str(args.version)
+
+    svnmucc_cmd = ['svnmucc', '-m',
+                   'Tagging release ' + str(args.version),
+                   '--username', args.username]
+    svnmucc_cmd += ['cp', str(args.revnum), branch, tag]
+    svnmucc_cmd += ['put', os.path.join(get_deploydir(args.base_dir),
+                                        'svn_version.h.dist'),
+                    tag + '/subversion/include/svn_version.h']
+
+    # don't redirect stdout/stderr since svnmucc might ask for a password
+    proc = subprocess.Popen(svnmucc_cmd)
+    proc.wait()
+
+#----------------------------------------------------------------------
 # Clean dist
 
 def clean_dist(args):
@@ -768,6 +796,20 @@ def main():
                     help='''Username for ''' + dist_repos + '''.  The default
                             is the current username''')
 
+    # Setup the parser for the create-tag subcommand
+    subparser = subparsers.add_parser('create-tag',
+                    help='''Create the release tag.''')
+    subparser.set_defaults(func=create_tag)
+    subparser.add_argument('version', type=Version,
+                    help='''The release label, such as '1.7.0-alpha1'.''')
+    subparser.add_argument('revnum', type=int,
+                    help='''The revision number to base the release on.''')
+    subparser.add_argument('--branch',
+                    help='''The branch to base the release on.''')
+    subparser.add_argument('--username', default=getpass.getuser(),
+                    help='''Username for ''' + dist_repos + '''.  The default
+                            is the current username''')
+
     # The clean-dist subcommand
     subparser = subparsers.add_parser('clean-dist',
                     help='''Clean the distribution directory (and mirrors) of