Rev 5618: (jelmer) Support finding default target for packaging branches in in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed Jan 19 01:03:45 UTC 2011


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5618 [merge]
revision-id: pqm at pqm.ubuntu.com-20110119010343-vqp4ddfjjddplr0v
parent: pqm at pqm.ubuntu.com-20110119002251-jvcp6iax3440b8it
parent: jelmer at samba.org-20110118214941-6w2ked0ivsrxrywt
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2011-01-19 01:03:43 +0000
message:
  (jelmer) Support finding default target for packaging branches in
   lp-propose. (Jelmer Vernooij)
modified:
  bzrlib/plugins/launchpad/lp_api.py lp_api.py-20090704082908-79il6zl4gugwl3wz-1
  bzrlib/plugins/launchpad/lp_propose.py lp_submit.py-20100120065117-penrmqruf596pui6-1
  doc/en/release-notes/bzr-2.4.txt bzr2.4.txt-20110114053217-k7ym9jfz243fddjm-1
=== modified file 'bzrlib/plugins/launchpad/lp_api.py'
--- a/bzrlib/plugins/launchpad/lp_api.py	2011-01-18 18:31:04 +0000
+++ b/bzrlib/plugins/launchpad/lp_api.py	2011-01-19 01:03:43 +0000
@@ -230,17 +230,26 @@
             raise errors.BzrError('%s is not registered on Launchpad' % url)
         return lp_branch
 
-    def get_dev_focus(self):
-        """Return the 'LaunchpadBranch' for the dev focus of this one."""
+    def get_target(self):
+        """Return the 'LaunchpadBranch' for the target of this one."""
         lp_branch = self.lp
-        if lp_branch.project is None:
-            raise errors.BzrError('%s has no product.' %
-                                  lp_branch.bzr_identity)
-        dev_focus = lp_branch.project.development_focus.branch
-        if dev_focus is None:
-            raise errors.BzrError('%s has no development focus.' %
-                                  lp_branch.bzr_identity)
-        return LaunchpadBranch(dev_focus, dev_focus.bzr_identity)
+        if lp_branch.project is not None:
+            dev_focus = lp_branch.project.development_focus.branch
+            if dev_focus is None:
+                raise errors.BzrError('%s has no development focus.' %
+                                  lp_branch.bzr_identity)
+            target = dev_focus.branch
+            if target is None:
+                raise errors.BzrError('development focus %s has no branch.' % dev_focus)
+        elif lp_branch.sourcepackage is not None:
+            target = lp_branch.sourcepackage.getBranch(pocket="Release")
+            if target is None:
+                raise errors.BzrError('source package %s has no branch.' %
+                                      lp_branch.sourcepackage)
+        else:
+            raise errors.BzrError('%s has no associated product or source package.' %
+                                  lp_branch.bzr_identity)
+        return LaunchpadBranch(target, target.bzr_identity)
 
     def update_lp(self):
         """Update the Launchpad copy of this branch."""

=== modified file 'bzrlib/plugins/launchpad/lp_propose.py'
--- a/bzrlib/plugins/launchpad/lp_propose.py	2011-01-17 00:23:03 +0000
+++ b/bzrlib/plugins/launchpad/lp_propose.py	2011-01-18 21:49:41 +0000
@@ -81,7 +81,7 @@
         self.source_branch = lp_api.LaunchpadBranch.from_bzr(
             self.launchpad, source_branch)
         if target_branch is None:
-            self.target_branch = self.source_branch.get_dev_focus()
+            self.target_branch = self.source_branch.get_target()
         else:
             self.target_branch = lp_api.LaunchpadBranch.from_bzr(
                 self.launchpad, target_branch)

=== modified file 'doc/en/release-notes/bzr-2.4.txt'
--- a/doc/en/release-notes/bzr-2.4.txt	2011-01-17 23:22:24 +0000
+++ b/doc/en/release-notes/bzr-2.4.txt	2011-01-19 01:03:43 +0000
@@ -41,6 +41,10 @@
 * ``bzr serve`` no longer crashes when a server_started hook is installed and IPv6
   support is available on the system. (Jelmer Vernooij, #293697)
 
+* ``bzr lp-propose`` can now propose merges against packaging branches on
+  Launhcpad without requiring the target branch to be specified. (Jelmer Vernooij,
+  #704647)
+
 Documentation
 *************
 




More information about the bazaar-commits mailing list