Merge lp:~clint-fewbar/charm-tools/add-unpromulgate into lp:~charmers/charm-tools/trunk

Proposed by Clint Byrum on 2012-04-28
Status: Merged
Approved by: Mark Mims on 2012-04-30
Approved revision: 131
Merged at revision: 132
Proposed branch: lp:~clint-fewbar/charm-tools/add-unpromulgate
Merge into: lp:~charmers/charm-tools/trunk
Diff against target: 67 lines (+26/-12)
2 files modified
scripts/promulgate (+23/-12)
scripts/unpromulgate (+3/-0)
To merge this branch: bzr merge lp:~clint-fewbar/charm-tools/add-unpromulgate
Reviewer Review Type Date Requested Status
Mark Mims (community) 2012-04-28 Approve on 2012-04-30
Review via email: mp+103965@code.launchpad.net

Description of the Change

Adds unpromulgate command to remove a branch rather than set it as the official one.

To post a comment you must log in.
Mark Mims (mark-mims) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scripts/promulgate'
2--- scripts/promulgate 2012-01-19 20:28:23 +0000
3+++ scripts/promulgate 2012-04-28 00:41:19 +0000
4@@ -56,6 +56,9 @@
5 parser.add_option(
6 '-v', '--verbose', dest='verbose', action='count', default=0,
7 help='Increase verbosity level.')
8+ parser.add_option(
9+ '-u', '--unpromulgate', dest='unpromulgate', action='store_true', default=False,
10+ help='Un-promulgate this branch instead of promulgating it')
11 options, args = parser.parse_args()
12
13 if options.verbose >= 2:
14@@ -98,15 +101,17 @@
15 logging.error("can't find branch on Launchpad: %s", options.branch)
16 return 1
17
18- logging.info(
19- "Setting status of %s to %s", charm_branch.bzr_identity,
20- OFFICAL_BRANCH_STATUS)
21- charm_branch.lifecycle_status = OFFICAL_BRANCH_STATUS
22- logging.info(
23- "Setting reviewer of %s to %s", charm_branch.bzr_identity,
24- REVIEW_TEAM_NAME)
25- charm_branch.reviewer = lp.people[REVIEW_TEAM_NAME]
26- charm_branch.lp_save()
27+ if not options.unpromulgate:
28+ logging.info(
29+ "Setting status of %s to %s", charm_branch.bzr_identity,
30+ OFFICAL_BRANCH_STATUS)
31+ charm_branch.lifecycle_status = OFFICAL_BRANCH_STATUS
32+ if not options.unpromulgate:
33+ logging.info(
34+ "Setting reviewer of %s to %s", charm_branch.bzr_identity,
35+ REVIEW_TEAM_NAME)
36+ charm_branch.reviewer = lp.people[REVIEW_TEAM_NAME]
37+ charm_branch.lp_save()
38
39 charm_distro = lp.distributions[DISTRIBUTION]
40 if options.series is None:
41@@ -125,9 +130,15 @@
42 raise
43
44 lp_charm = charm_series.getSourcePackage(name=charm['name'])
45- logging.info(
46- 'Setting %s as the official branch for %s',
47- charm_branch.bzr_identity, lp_charm.name)
48+ if options.unpromulgate:
49+ logging.info('Removing official branch for %s', lp_charm.name)
50+ # None translates to 'null' in the args, which makes LP delete
51+ # the source package.
52+ charm_branch = None
53+ else:
54+ logging.info(
55+ 'Setting %s as the official branch for %s',
56+ charm_branch.bzr_identity, lp_charm.name)
57 lp_charm.setBranch(branch=charm_branch, pocket=OFFICIAL_BRANCH_POCKET)
58
59 return 0
60
61=== added file 'scripts/unpromulgate'
62--- scripts/unpromulgate 1970-01-01 00:00:00 +0000
63+++ scripts/unpromulgate 2012-04-28 00:41:19 +0000
64@@ -0,0 +1,3 @@
65+#!/bin/sh
66+# Alias for convenience/sanity
67+exec `dirname $0`/promulgate --unpromulgate $@

Subscribers

People subscribed via source and target branches