[MediaWiki-commits] [Gerrit] mediawiki...release[master]: Fix branch.py

2018-01-09 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/403155 )

Change subject: Fix branch.py
..


Fix branch.py

- Support bundles other than base
- Protect core branching with a flag
- Require explicit "really branch everything" syntax
- Remove unused options (they'll be back)
- Make manual branch points actually work

Change-Id: I0e0cbfd99e0247d35ee3a3065bf3527313def059
---
M make-release/branch.py
1 file changed, 16 insertions(+), 19 deletions(-)

Approvals:
  Chad: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/make-release/branch.py b/make-release/branch.py
index bc76e74..6e2bf3e 100755
--- a/make-release/branch.py
+++ b/make-release/branch.py
@@ -24,9 +24,14 @@
 auth=HTTPDigestAuth(CONFIG['username'], CONFIG['password']))
 
 
-def create_branch(repository, branch, revision='HEAD'):
+def create_branch(repository, branch, revision):
 """Create a branch for a given repo."""
 try:
+try:
+revision = CONFIG['manual_branch_points'][branch][repository]
+except KeyError:
+pass
+
 _get_client().put(
 '/projects/%s/branches/%s' % (
 repository.replace('/', '%2F'),
@@ -40,22 +45,12 @@
 raise
 
 
-def branch_core(branch, branch_point='HEAD'):
-"""Just branch core."""
-create_branch('core', branch, branch_point)
-
-
-def branch_everything(branch, branch_point='HEAD', bundle=None):
+def branch_everything(branch, branch_point, bundle=None):
 """Branch stuff."""
-if not bundle:
+if bundle == '*':
 repos_to_branch = get_star_bundle()
 
 for repo in repos_to_branch:
-try:
-branch_point = CONFIG['manual_branch_points'][branch][repo]
-except KeyError:
-pass
-
 print('Branching %s to %s from %s' % (
 repo, branch, branch_point))
 create_branch(repo, branch, branch_point)
@@ -83,10 +78,10 @@
 parser.add_argument('branch', nargs='?', help='Branch we want to make')
 parser.add_argument('--branchpoint', dest='branch_point', default='HEAD',
 help='Where to branch from')
-parser.add_argument('--submodules', dest='submodules', action='store_true',
-help='Add the newly branched repos as submodules?')
-parser.add_argument('--set-version', dest='set_version',
-help='Update $wgVersion?')
+parser.add_argument('--core', dest='core', action='store_true',
+help='If we branch core or not')
+parser.add_argument('--bundle', dest='bundle', default=None,
+help='What bundle of extensions & skins to branch')
 
 return parser.parse_args()
 
@@ -95,5 +90,7 @@
 OPTIONS = parse_args()
 logging.basicConfig(level=logging.INFO, stream=sys.stderr)
 
-branch_core(OPTIONS.branch, OPTIONS.branch_point)
-branch_everything(OPTIONS.branch, OPTIONS.branch_point)
+if OPTIONS.core:
+create_branch('core', OPTIONS.branch, OPTIONS.branch_point)
+if OPTIONS.bundle:
+branch_everything(OPTIONS.branch, OPTIONS.branch_point, OPTIONS.bundle)

-- 
To view, visit https://gerrit.wikimedia.org/r/403155
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0e0cbfd99e0247d35ee3a3065bf3527313def059
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/release
Gerrit-Branch: master
Gerrit-Owner: Chad 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...release[master]: Fix branch.py

2018-01-09 Thread Chad (Code Review)
Chad has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403155 )

Change subject: Fix branch.py
..

Fix branch.py

- Support bundles other than base
- Protect core branching with a flag
- Require explicit "really branch everything" syntax
- Remove unused options (they'll be back)
- Make manual branch points actually work

Change-Id: I0e0cbfd99e0247d35ee3a3065bf3527313def059
---
M make-release/branch.py
1 file changed, 16 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/release 
refs/changes/55/403155/1

diff --git a/make-release/branch.py b/make-release/branch.py
index bc76e74..6e2bf3e 100755
--- a/make-release/branch.py
+++ b/make-release/branch.py
@@ -24,9 +24,14 @@
 auth=HTTPDigestAuth(CONFIG['username'], CONFIG['password']))
 
 
-def create_branch(repository, branch, revision='HEAD'):
+def create_branch(repository, branch, revision):
 """Create a branch for a given repo."""
 try:
+try:
+revision = CONFIG['manual_branch_points'][branch][repository]
+except KeyError:
+pass
+
 _get_client().put(
 '/projects/%s/branches/%s' % (
 repository.replace('/', '%2F'),
@@ -40,22 +45,12 @@
 raise
 
 
-def branch_core(branch, branch_point='HEAD'):
-"""Just branch core."""
-create_branch('core', branch, branch_point)
-
-
-def branch_everything(branch, branch_point='HEAD', bundle=None):
+def branch_everything(branch, branch_point, bundle=None):
 """Branch stuff."""
-if not bundle:
+if bundle == '*':
 repos_to_branch = get_star_bundle()
 
 for repo in repos_to_branch:
-try:
-branch_point = CONFIG['manual_branch_points'][branch][repo]
-except KeyError:
-pass
-
 print('Branching %s to %s from %s' % (
 repo, branch, branch_point))
 create_branch(repo, branch, branch_point)
@@ -83,10 +78,10 @@
 parser.add_argument('branch', nargs='?', help='Branch we want to make')
 parser.add_argument('--branchpoint', dest='branch_point', default='HEAD',
 help='Where to branch from')
-parser.add_argument('--submodules', dest='submodules', action='store_true',
-help='Add the newly branched repos as submodules?')
-parser.add_argument('--set-version', dest='set_version',
-help='Update $wgVersion?')
+parser.add_argument('--core', dest='core', action='store_true',
+help='If we branch core or not')
+parser.add_argument('--bundle', dest='bundle', default=None,
+help='What bundle of extensions & skins to branch')
 
 return parser.parse_args()
 
@@ -95,5 +90,7 @@
 OPTIONS = parse_args()
 logging.basicConfig(level=logging.INFO, stream=sys.stderr)
 
-branch_core(OPTIONS.branch, OPTIONS.branch_point)
-branch_everything(OPTIONS.branch, OPTIONS.branch_point)
+if OPTIONS.core:
+create_branch('core', OPTIONS.branch, OPTIONS.branch_point)
+if OPTIONS.bundle:
+branch_everything(OPTIONS.branch, OPTIONS.branch_point, OPTIONS.bundle)

-- 
To view, visit https://gerrit.wikimedia.org/r/403155
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0e0cbfd99e0247d35ee3a3065bf3527313def059
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/release
Gerrit-Branch: master
Gerrit-Owner: Chad 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits