diff --git a/bench/prepare_beta_release.py b/bench/prepare_beta_release.py index 09809c78..dfcf7642 100644 --- a/bench/prepare_beta_release.py +++ b/bench/prepare_beta_release.py @@ -17,9 +17,6 @@ def prepare_beta_release(bench_path, app, owner='frappe', remote='upstream'): if click.confirm("Do you want to setup hotfix for beta ?"): beta_hotfix = click.prompt('Branch name for beta hotfix ({}_hotifx)'.format(beta_master), type=str) - - print(beta_master, beta_hotfix) - validate(bench_path) repo_path = os.path.join(bench_path, 'apps', app) version = get_bummped_version(repo_path) @@ -92,10 +89,8 @@ def merge_beta_release_to_develop(repo_path, beta_master, remote, version): g.checkout('develop') try: - print(beta_master) g.merge(beta_master) except git.exc.GitCommandError as e: - print("here") handle_merge_error(e, source=beta_master, target='develop') return tag_name @@ -114,7 +109,7 @@ def push_branches(repo_path, beta_master, beta_hotfix, remote): args.append('--tags') - print("Pushing new branches") + print("Pushing branches") print(g.push(remote, *args)) def create_github_release(repo_path, tag_name, message, owner, remote): diff --git a/bench/release.py b/bench/release.py index 32e75be8..ed50e436 100755 --- a/bench/release.py +++ b/bench/release.py @@ -137,24 +137,19 @@ def bump_repo(repo_path, bump_type, from_branch='develop', to_branch='master'): def get_current_version(repo_path, to_branch): # TODO clean this up! + version_key = '__version__' if to_branch.lower() == 'master': filename = os.path.join(repo_path, os.path.basename(repo_path), '__init__.py') - - with open(filename) as f: - contents = f.read() - match = re.search(r"^(\s*%s\s*=\s*['\\\"])(.+?)(['\"])(?sm)" % '__version__', - contents) - return match.group(2) - else: filename = os.path.join(repo_path, os.path.basename(repo_path), 'hooks.py') - - with open(filename) as f: - contents = f.read() - match = re.search(r"^(\s*%s\s*=\s*['\\\"])(.+?)(['\"])(?sm)" % 'beta_version', - contents) - return match.group(2) + version_key = 'beta_version' + + with open(filename) as f: + contents = f.read() + match = re.search(r"^(\s*%s\s*=\s*['\\\"])(.+?)(['\"])(?sm)" % version_key, + contents) + return match.group(2) def get_bumped_version(version, bump_type): v = semantic_version.Version(version)