10 parser = argparse.ArgumentParser(description = "Build and tag a release.")
11 parser.add_argument('-f', '--full', dest='full', action='store_const', const=True, help="full release", default=False)
12 parser.add_argument('-b', '--beta', dest='beta', action='store_const', const=True, help="beta release", default=False)
13 parser.add_argument('-d', '--debug', dest='debug', action='store_const', const=True, help="show commands but don't do anything", default=False)
14 args = parser.parse_args()
16 if not args.full and not args.beta:
17 print "%s: must specify --full or --beta" % sys.argv[0]
25 def check_diff_with_user():
26 print "Planning to commit... ok? [y/n]"
28 if (raw_input() != "y"):
29 command("git reset --hard")
33 if not args.debug and os.popen('git status -s').read() != '':
34 print '%s: uncommitted changes exist.' % sys.argv[0]
37 m = version.Version.to_release
39 m = version.Version.bump_beta
41 new_version = version.rewrite_wscript(m)
42 version.append_to_changelog(new_version)
43 command("dch -v %s-1 \"New upstream release.\"" % new_version)
45 command("./waf clean")
48 check_diff_with_user()
50 command("git commit -a -m \"Bump version\"")
51 command("git tag -m \"v%s\" v%s" % (new_version, new_version))
54 version.rewrite_wscript(version.Version.bump_and_to_pre)
55 check_diff_with_user()
56 command("git commit -a -m \"Bump version\"")