def create_branches_and_update_versions(branch_base, version): if util.unstaged_changes_present(REPOS): raise Exception("one of the branches has unstaged changes, " + "please stash and try again") util.pull_masters(REPOS) branch_name = "{}{}".format(branch_base, version) if util.branch_exists_in_repos(branch_name, REPOS): raise Exception("commcare_{} branch already exists".format(version)) create_release_branches(branch_name) update_version_numbers()
def close_branches(branch_name): if not util.branch_exists_in_repos(branch_name, REPOS): raise Exception("{} branch doesn't exists".format(branch_name)) print("removing local instances of the {} branch".format(branch_name)) print("You will also want to close the remote github branches") print("\tthis'll be automated once the script's been working for a while.") for repo in REPOS: util.chdir_repo(repo) print("removing {} branch of {} repo".format(branch_name, repo)) subprocess.call('git checkout master', shell=True) subprocess.call('git branch -d {}'.format(branch_name), shell=True) util.chdir_base()
def create_release_tags(branch_base, version): if util.unstaged_changes_present(REPOS): raise Exception("A branch has unstaged changes, stash and try again") branch_name = "{}{}".format(branch_base, version.short_string()) tag_name = "{}{}".format(branch_base, version) if not util.branch_exists_in_repos(branch_name, REPOS): raise Exception("{} branch doesn't exist".format(branch_name)) # TODO PLM: run this on J2ME releases: # mark_version_as_release(branch_name) add_hotfix_version_to_android(branch_name, 0) create_tags_for_repos(branch_name, tag_name) return tag_name