Rev 6479: (jelmer) Add --link-bug option to 'bzr lp-propose'. (Ross Lagerwall) in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/

Patch Queue Manager pqm at pqm.ubuntu.com
Sun Mar 4 18:21:05 UTC 2012


At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 6479 [merge]
revision-id: pqm at pqm.ubuntu.com-20120304182104-8y1tdavoblrrhflc
parent: pqm at pqm.ubuntu.com-20120227170005-y7bp8qlwln5gsl38
parent: rosslagerwall at gmail.com-20120226154302-ix3md8zl778gv7x3
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Sun 2012-03-04 18:21:04 +0000
message:
  (jelmer) Add --link-bug option to 'bzr lp-propose'. (Ross Lagerwall)
modified:
  bzrlib/plugins/launchpad/__init__.py __init__.py-20060315182712-2d5feebd2a1032dc
  bzrlib/plugins/launchpad/lp_propose.py lp_submit.py-20100120065117-penrmqruf596pui6-1
=== modified file 'bzrlib/plugins/launchpad/__init__.py'
--- a/bzrlib/plugins/launchpad/__init__.py	2012-02-07 12:59:07 +0000
+++ b/bzrlib/plugins/launchpad/__init__.py	2012-02-26 15:43:02 +0000
@@ -342,6 +342,7 @@
                             help='Commit message.'),
                      Option('approve',
                             help='Mark the proposal as approved immediately.'),
+                     Option('fixes', 'The bug this proposal fixes.', str),
                      ListOption('review', short_name='R', type=unicode,
                             help='Requested reviewer and optional type.')]
 
@@ -350,7 +351,7 @@
     aliases = ['lp-submit', 'lp-propose']
 
     def run(self, submit_branch=None, review=None, staging=False,
-            message=None, approve=False):
+            message=None, approve=False, fixes=None):
         from bzrlib.plugins.launchpad import lp_propose
         tree, branch, relpath = bzrdir.BzrDir.open_containing_tree_or_branch(
             '.')
@@ -370,7 +371,8 @@
         else:
             target = _mod_branch.Branch.open(submit_branch)
         proposer = lp_propose.Proposer(tree, branch, target, message,
-                                       reviews, staging, approve=approve)
+                                       reviews, staging, approve=approve,
+                                       fixes=fixes)
         proposer.check_proposal()
         proposer.create_proposal()
 

=== modified file 'bzrlib/plugins/launchpad/lp_propose.py'
--- a/bzrlib/plugins/launchpad/lp_propose.py	2011-12-18 15:28:38 +0000
+++ b/bzrlib/plugins/launchpad/lp_propose.py	2012-02-26 15:43:02 +0000
@@ -52,7 +52,7 @@
     hooks = ProposeMergeHooks()
 
     def __init__(self, tree, source_branch, target_branch, message, reviews,
-                 staging=False, approve=False):
+                 staging=False, approve=False, fixes=None):
         """Constructor.
 
         :param tree: The working tree for the source branch.
@@ -90,6 +90,7 @@
                             for reviewer, review_type in
                             reviews]
         self.approve = approve
+        self.fixes = fixes
 
     def get_comment(self, prerequisite_branch):
         """Determine the initial comment for the merge proposal."""
@@ -203,6 +204,12 @@
             review_types=review_types)
         if self.approve:
             self.call_webservice(mp.setStatus, status='Approved')
+        if self.fixes:
+            if self.fixes.startswith('lp:'):
+                self.fixes = self.fixes[3:]
+            self.call_webservice(
+                self.source_branch.lp.linkBug,
+                bug=self.launchpad.bugs[int(self.fixes)])
         webbrowser.open(lp_api.canonical_url(mp))
 
 




More information about the bazaar-commits mailing list