mirror of
https://github.com/frappe/bench.git
synced 2025-01-22 22:58:31 +00:00
remove debuggin statements and removed redundent code
This commit is contained in:
parent
ab2f8e998d
commit
9039b12d9f
@ -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 ?"):
|
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)
|
beta_hotfix = click.prompt('Branch name for beta hotfix ({}_hotifx)'.format(beta_master), type=str)
|
||||||
|
|
||||||
|
|
||||||
print(beta_master, beta_hotfix)
|
|
||||||
|
|
||||||
validate(bench_path)
|
validate(bench_path)
|
||||||
repo_path = os.path.join(bench_path, 'apps', app)
|
repo_path = os.path.join(bench_path, 'apps', app)
|
||||||
version = get_bummped_version(repo_path)
|
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')
|
g.checkout('develop')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
print(beta_master)
|
|
||||||
g.merge(beta_master)
|
g.merge(beta_master)
|
||||||
except git.exc.GitCommandError as e:
|
except git.exc.GitCommandError as e:
|
||||||
print("here")
|
|
||||||
handle_merge_error(e, source=beta_master, target='develop')
|
handle_merge_error(e, source=beta_master, target='develop')
|
||||||
|
|
||||||
return tag_name
|
return tag_name
|
||||||
@ -114,7 +109,7 @@ def push_branches(repo_path, beta_master, beta_hotfix, remote):
|
|||||||
|
|
||||||
args.append('--tags')
|
args.append('--tags')
|
||||||
|
|
||||||
print("Pushing new branches")
|
print("Pushing branches")
|
||||||
print(g.push(remote, *args))
|
print(g.push(remote, *args))
|
||||||
|
|
||||||
def create_github_release(repo_path, tag_name, message, owner, remote):
|
def create_github_release(repo_path, tag_name, message, owner, remote):
|
||||||
|
@ -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):
|
def get_current_version(repo_path, to_branch):
|
||||||
# TODO clean this up!
|
# TODO clean this up!
|
||||||
|
version_key = '__version__'
|
||||||
|
|
||||||
if to_branch.lower() == 'master':
|
if to_branch.lower() == 'master':
|
||||||
filename = os.path.join(repo_path, os.path.basename(repo_path), '__init__.py')
|
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:
|
else:
|
||||||
filename = os.path.join(repo_path, os.path.basename(repo_path), 'hooks.py')
|
filename = os.path.join(repo_path, os.path.basename(repo_path), 'hooks.py')
|
||||||
|
version_key = 'beta_version'
|
||||||
with open(filename) as f:
|
|
||||||
contents = f.read()
|
with open(filename) as f:
|
||||||
match = re.search(r"^(\s*%s\s*=\s*['\\\"])(.+?)(['\"])(?sm)" % 'beta_version',
|
contents = f.read()
|
||||||
contents)
|
match = re.search(r"^(\s*%s\s*=\s*['\\\"])(.+?)(['\"])(?sm)" % version_key,
|
||||||
return match.group(2)
|
contents)
|
||||||
|
return match.group(2)
|
||||||
|
|
||||||
def get_bumped_version(version, bump_type):
|
def get_bumped_version(version, bump_type):
|
||||||
v = semantic_version.Version(version)
|
v = semantic_version.Version(version)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user