Merge lp:~jelmer/lptools/force-branch-mirror into lp:lptools

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: 25
Merged at revision: 32
Proposed branch: lp:~jelmer/lptools/force-branch-mirror
Merge into: lp:lptools
Diff against target: 37 lines (+33/-0)
1 file modified
bin/lp-force-branch-mirror (+33/-0)
To merge this branch: bzr merge lp:~jelmer/lptools/force-branch-mirror
Reviewer Review Type Date Requested Status
Martin Pool Approve
Review via email: mp+73176@code.launchpad.net

Description of the change

Import "force-branch-mirror" script from hydrazine, which forces the mirrorring of a code mirror.

To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'bin/lp-force-branch-mirror'
2--- bin/lp-force-branch-mirror 1970-01-01 00:00:00 +0000
3+++ bin/lp-force-branch-mirror 2011-08-28 11:24:17 +0000
4@@ -0,0 +1,33 @@
5+#! /usr/bin/python
6+# vi: expandtab:sts=4
7+
8+# Copyright (C) 2011 Jelmer Vernooij
9+
10+"""Force a new import
11+"""
12+
13+import optparse
14+import sys
15+
16+from lptools import config
17+
18+
19+def main(argv):
20+ parser = optparse.OptionParser('%prog [options] BRANCH...\n\n'
21+ ' PROJECT is the launchpad project to inspect (eg bzr)')
22+ opts, args = parser.parse_args()
23+ if len(args) != 1:
24+ parser.print_usage()
25+ return 1
26+
27+ lp = config.get_launchpad("force-branch-mirror")
28+ branches = lp.branches.getByUrls(urls=args)
29+ for url, branch_dict in branches.iteritems():
30+ if branch_dict is None:
31+ print "Branch %s not found" % url
32+ else:
33+ branch = lp.load(branch_dict["self_link"])
34+ print "%s: %s" % (branch.bzr_identity, branch.requestMirror())
35+
36+if __name__ == '__main__':
37+ sys.exit(main(sys.argv))

Subscribers

People subscribed via source and target branches