From 783a6e7d02949cc5eeaba2696fa5c69aef4922a6 Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Sat, 22 Aug 2015 16:56:29 -0700 Subject: [PATCH] Add switch-to-v5 #142 --- bench/app.py | 3 +++ bench/cli.py | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/bench/app.py b/bench/app.py index 7591c590..f6996f4e 100644 --- a/bench/app.py +++ b/bench/app.py @@ -179,6 +179,9 @@ def switch_to_develop(apps=None, bench='.', upgrade=False): def switch_to_v4(apps=None, bench='.', upgrade=False): switch_branch('v4.x.x', apps=apps, bench=bench, upgrade=upgrade) +def switch_to_v5(apps=None, bench='.', upgrade=False): + switch_branch('v5.x.x', apps=apps, bench=bench, upgrade=upgrade) + def get_version_from_string(contents): match = re.search(r"^(\s*%s\s*=\s*['\\\"])(.+?)(['\"])(?sm)" % 'version', contents) diff --git a/bench/cli.py b/bench/cli.py index 8f0184b6..d40bd49a 100644 --- a/bench/cli.py +++ b/bench/cli.py @@ -17,7 +17,7 @@ from .utils import (build_assets, patch_sites, exec_cmd, update_bench, get_env_c pre_upgrade, validate_upgrade, PatchError, download_translations_p, setup_socketio) from .app import get_app as _get_app from .app import new_app as _new_app -from .app import pull_all_apps, get_apps, get_current_frappe_version, is_version_upgrade, switch_to_v4, switch_to_master, switch_to_develop +from .app import pull_all_apps, get_apps, get_current_frappe_version, is_version_upgrade, switch_to_v4, switch_to_v5, switch_to_master, switch_to_develop from .config import generate_nginx_config, generate_supervisor_config, generate_redis_cache_config, generate_redis_async_broker_config from .production_setup import setup_production as _setup_production from .migrate_to_v5 import migrate_to_v5 @@ -339,6 +339,15 @@ def _switch_to_v4(upgrade=False): print 'Switched to v4' print 'Please run `bench update --patch` to be safe from any differences in database schema' +@click.command('switch-to-v5') +@click.option('--upgrade',is_flag=True) +def _switch_to_v5(upgrade=False): + "Switch frappe and erpnext to v4 branch" + switch_to_v5(upgrade=upgrade) + print + print 'Switched to v5' + print 'Please run `bench update --patch` to be safe from any differences in database schema' + @click.command('set-nginx-port') @click.argument('site') @click.argument('port', type=int) @@ -611,6 +620,7 @@ bench.add_command(migrate_3to4) bench.add_command(_switch_to_master) bench.add_command(_switch_to_develop) bench.add_command(_switch_to_v4) +bench.add_command(_switch_to_v5) bench.add_command(shell) bench.add_command(_backup_all_sites) bench.add_command(_backup_site)