Merge lp:~flacoste/charm-tools/bug-797810 into lp:~charmers/charm-tools/trunk

Proposed by Francis J. Lacoste
Status: Merged
Merged at revision: 62
Proposed branch: lp:~flacoste/charm-tools/bug-797810
Merge into: lp:~charmers/charm-tools/trunk
Diff against target: 46 lines (+21/-1)
1 file modified
scripts/promulgate (+21/-1)
To merge this branch: bzr merge lp:~flacoste/charm-tools/bug-797810
Reviewer Review Type Date Requested Status
Clint Byrum (community) Approve
Review via email: mp+64752@code.launchpad.net

Description of the change

Hi,

This adds a --series option to allow setting official source package branch in
other series than the current development focus.

To post a comment you must log in.
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Thanks Francis! Merged

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 2011-06-14 21:13:16 +0000
3+++ scripts/promulgate 2011-06-15 21:03:35 +0000
4@@ -20,6 +20,7 @@
5 #
6
7 from launchpadlib.launchpad import Launchpad
8+from lazr.restfulclient.errors import BadRequest, NotFound
9
10 import os
11 import sys
12@@ -45,6 +46,10 @@
13 help='The location of the formula public branch. Will be determined '
14 'from the bzr configuration if omitted.')
15 parser.add_option(
16+ '-s', '--series', dest='series', default=None,
17+ help='The distribution series on which to set the official branch. '
18+ 'Defaults to setting it in the current development series.')
19+ parser.add_option(
20 '-t', '--lp-instance', dest='lp_instance', default='production',
21 help="The Launchpad instance to use. Defaults to production, but "
22 "staging' or 'qastaging' might be used for testing.")
23@@ -98,7 +103,22 @@
24 formula_branch.reviewer = lp.people[REVIEW_TEAM_NAME]
25 formula_branch.lp_save()
26
27- principia_series = lp.distributions[DISTRIBUTION].current_series
28+ principia = lp.distributions[DISTRIBUTION]
29+ if options.series is None:
30+ principia_series = principia.current_series
31+ else:
32+ try:
33+ principia_series = principia.getSeries(
34+ name_or_version=options.series)
35+ except (BadRequest, NotFound), e:
36+ # XXX flacoste 2011-06-15 bug=797917
37+ # Should only be NotFound.
38+ if e.content.startswith('No such distribution series:'):
39+ logging.error("can't find series '%s'", options.series)
40+ return 1
41+ else:
42+ raise
43+
44 lp_formula = principia_series.getSourcePackage(name=formula['name'])
45 logging.info(
46 'Setting %s as the official branch for %s',

Subscribers

People subscribed via source and target branches