2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-12 00:06:36 +00:00

compare app and repo to set repo

This commit is contained in:
Revant Nandgaonkar 2016-05-17 21:47:40 +05:30 committed by Anand Doshi
parent 40247bae0f
commit 6a0a7223d2

View File

@ -60,9 +60,7 @@ def update_branches_and_check_for_changelog(repo, bump_type, develop='develop',
if develop != 'develop':
update_branch(repo, 'develop', remote=remote, app=app)
if os.path.basename(repo) != app:
repo = app
repo = os.path.join('apps', repo)
repo = os.path.join('apps', app) if os.path.basename(repo) != app else repo
git.Repo(repo).git.checkout(develop)
check_for_unmerged_changelog(repo)
@ -87,10 +85,7 @@ def check_for_unmerged_changelog(repo):
def get_release_message(repo_path, develop_branch='develop', master_branch='master', app=None):
if os.path.basename(repo_path) != app:
repo_path = app
repo_path = os.path.join('apps', repo_path)
repo_path = os.path.join('apps', app) if os.path.basename(repo_path) != app else repo_path
print 'getting release message for', repo_path, 'comparing', master_branch, '...', develop_branch
repo = git.Repo(repo_path)
@ -101,9 +96,7 @@ def get_release_message(repo_path, develop_branch='develop', master_branch='mast
def bump_repo(repo, bump_type, develop='develop', master='master', remote='upstream', app=None):
if os.path.basename(repo) != app:
repo = app
repo = os.path.join('apps', repo)
repo = os.path.join('apps', app) if os.path.basename(repo) != app else repo
current_version = get_current_version(repo)
new_version = get_bumped_version(current_version, bump_type)
@ -167,9 +160,7 @@ def set_filename_version(filename, version_number, pattern):
f.write(contents)
def commit_changes(repo_path, version, app=None):
if os.path.basename(repo_path) != app:
repo_path = app
repo_path = os.path.join('apps', repo_path)
repo_path = os.path.join('apps', app) if os.path.basename(repo_path) != app else repo_path
print 'committing version change to', repo_path
@ -182,9 +173,7 @@ def commit_changes(repo_path, version, app=None):
def create_release(repo_path, version, remote='origin', develop_branch='develop', master_branch='master', app=None):
if os.path.basename(repo_path) != app:
repo_path = app
repo_path = os.path.join('apps', repo_path)
repo_path = os.path.join('apps', app) if os.path.basename(repo_path) != app else repo_path
print 'creating release for version', version
repo = git.Repo(repo_path)
@ -205,9 +194,7 @@ def create_release(repo_path, version, remote='origin', develop_branch='develop'
def push_release(repo_path, develop_branch='develop', master_branch='master', app=None):
if os.path.basename(repo_path) != app:
repo_path = app
repo_path = os.path.join('apps', repo_path)
repo_path = os.path.join('apps', app) if os.path.basename(repo_path) != app else repo_path
print 'pushing branches', master_branch, develop_branch, 'of', repo_path
repo = git.Repo(repo_path)