manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1645489 - /manifoldcf/release-scripts/create_release_branch.py
Date Sun, 14 Dec 2014 18:38:40 GMT
Author: kwright
Date: Sun Dec 14 18:38:39 2014
New Revision: 1645489

URL: http://svn.apache.org/r1645489
Log:
Modify script to deal with release branches off of dev_1x

Modified:
    manifoldcf/release-scripts/create_release_branch.py

Modified: manifoldcf/release-scripts/create_release_branch.py
URL: http://svn.apache.org/viewvc/manifoldcf/release-scripts/create_release_branch.py?rev=1645489&r1=1645488&r2=1645489&view=diff
==============================================================================
--- manifoldcf/release-scripts/create_release_branch.py (original)
+++ manifoldcf/release-scripts/create_release_branch.py Sun Dec 14 18:38:39 2014
@@ -446,7 +446,7 @@ def create_branch(trunk_url, branch_url,
     svn_command([ "-m", branch_message, "copy", trunk_url, branch_url])
     #print "Pretend create branch..."
 
-def create_release_branch(release_version, new_trunk_version, working_directory):
+def create_release_branch(starting_branch, release_version, new_trunk_version, working_directory):
     """ Create a release branch, and modify trunk also to reset versions """
     # Basic checks
     if not os.path.exists(working_directory):
@@ -454,18 +454,18 @@ def create_release_branch(release_versio
     if release_version.find("-SNAPSHOT") >= 0 or release_version.find("-dev") >= 0:
         raise Exception("Release version '%s' cannot contain SNAPSHOT or dev" % release_version)
     if new_trunk_version.find("-SNAPSNOT") >= 0 or new_trunk_version.find("-dev") >=
0:
-        raise Exception("New trunk version '%s' cannot contain SNAPSHOT or dev" % new_trunk_version)
+        raise Exception("New %s version '%s' cannot contain SNAPSHOT or dev" % (starting_branch,
new_trunk_version))
 
     # Point to all the right places
-    trunk_url = "https://svn.apache.org/repos/asf/manifoldcf/trunk"
+    trunk_url = "https://svn.apache.org/repos/asf/manifoldcf/%s" % starting_branch
     branch_url = "https://svn.apache.org/repos/asf/manifoldcf/branches/release-%s-branch"
% release_version
-    trunk_dir = "%s/trunk" % working_directory
+    trunk_dir = "%s/start_branch" % working_directory
     
     trunk_changes_file = "%s/CHANGES.txt" % trunk_dir
     trunk_build_xml_file = "%s/build.xml" % trunk_dir
     
     # Check out trunk.
-    print >>sys.stderr, "Checking out trunk..."
+    print >>sys.stderr, "Checking out %s..." % starting_branch
     checkout_tree(trunk_dir, trunk_url)
 
     # First, tie off trunk.  Then we can branch.
@@ -477,7 +477,7 @@ def create_release_branch(release_versio
     update_poms(trunk_dir, release_version)
     
     # Commit trunk
-    print >>sys.stderr, "Committing trunk release version tie-off..."
+    print >>sys.stderr, "Committing %s release version tie-off..." % starting_branch
     commit_tree(trunk_dir, "Tie off release %s" % release_version)
     
     # Now, create branch!!
@@ -488,26 +488,30 @@ def create_release_branch(release_versio
     add_change_file_new_dev_row(trunk_changes_file, new_trunk_version)
     fix_build_xml(trunk_build_xml_file, "%s-dev" % new_trunk_version)
     update_poms(trunk_dir, "%s-SNAPSHOT" % new_trunk_version)
-    print >>sys.stderr, "Committing trunk version increment..."
-    commit_tree(trunk_dir, "Prepare trunk for %s development" % new_trunk_version)
+    print >>sys.stderr, "Committing %s version increment..." % starting_branch
+    commit_tree(trunk_dir, "Prepare %s for %s development" % (starting_branch, new_trunk_version))
     
     # Finally, delete trunk checkout (we're done with it)
-    print >>sys.stderr, "Cleaning up trunk temporary files..."
+    print >>sys.stderr, "Cleaning up %s temporary files..." % starting_branch
     remove_dir(trunk_dir)
     print >>sys.stderr, "Release branch created!"
 
 if __name__ == '__main__':
-    if len(sys.argv) != 3 and len(sys.argv) != 4:
-        print >> sys.stderr, "Usage: %s <release_branch_version> <new_trunk_version>
[<working_directory>]" % sys.argv[0]
+    if len(sys.argv) != 3 and len(sys.argv) != 4 and len(sys.argv) != 5:
+        print >> sys.stderr, "Usage: %s <release_branch_version> <new_trunk_version>
[<starting_branch> [<working_directory>]]" % sys.argv[0]
         sys.exit(1)
     
     release_version = sys.argv[1]
     trunk_version = sys.argv[2]
     if len(sys.argv) > 3:
-        working_dir = sys.argv[3]
+        starting_branch = sys.argv[3]
+    else:
+        starting_branch = "trunk"
+    if len(sys.argv) > 4:
+        working_dir = sys.argv[4]
     else:
         working_dir = "."
     
-    create_release_branch(release_version, trunk_version, working_dir)
+    create_release_branch(starting_branch, release_version, trunk_version, working_dir)
     
     
\ No newline at end of file



Mime
View raw message