2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-11 15:51:03 +00:00

make rebase when pulling configurable, fix #39

This commit is contained in:
Pratik Vyas 2014-07-25 15:20:01 +05:30
parent 78ba5f2c4a
commit 2d2d98969c
3 changed files with 12 additions and 2 deletions

View File

@ -40,11 +40,12 @@ def install_app(app, bench='.'):
def pull_all_apps(bench='.'):
apps_dir = os.path.join(bench, 'apps')
apps = [app for app in os.listdir(apps_dir) if os.path.isdir(os.path.join(apps_dir, app))]
rebase = '--rebase' if get_config().get('rebase_on_pull') else ''
for app in apps:
app_dir = os.path.join(apps_dir, app)
if os.path.exists(os.path.join(app_dir, '.git')):
logger.info('pulling {}'.format(app))
exec_cmd("git pull --rebase upstream HEAD", cwd=app_dir)
exec_cmd("git pull {rebase} upstream HEAD".format(rebase=rebase), cwd=app_dir)
def install_apps_from_path(path, bench='.'):
apps = get_apps_dict(path)

View File

@ -227,15 +227,23 @@ def config_dns_multitenant(state):
@click.command('serve_default_site')
@click.argument('state', type=click.Choice(['on', 'off']))
def config_dns_multitenant(state):
def config_serve_default_site(state):
"Configure nginx to serve the default site on port 80"
state = True if state == 'on' else False
update_config({'serve_default_site': state})
@click.command('rebase_on_pull')
@click.argument('state', type=click.Choice(['on', 'off']))
def config_rebase_on_pull(state):
"Rebase repositories on pulling"
state = True if state == 'on' else False
update_config({'rebase_on_pull': state})
config.add_command(config_auto_update)
config.add_command(config_update_bench_on_update)
config.add_command(config_restart_supervisor_on_update)
config.add_command(config_dns_multitenant)
config.add_command(config_serve_default_site)
#Bench commands

View File

@ -12,6 +12,7 @@ default_config = {
'restart_supervisor_on_update': False,
'auto_update': True,
'serve_default_site': True,
'rebase_on_pull': False,
'update_bench_on_update': True,
'shallow_clone': True
}