Rev 4872: (nmb) Use open-containing for 'bzr lp-open' in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Mon Dec 7 20:29:50 GMT 2009


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

------------------------------------------------------------
revno: 4872 [merge]
revision-id: pqm at pqm.ubuntu.com-20091207202945-iwelfw14uf2mpn44
parent: pqm at pqm.ubuntu.com-20091207151558-0f1ws7jungrooq89
parent: nmb at wartburg.edu-20091207170755-e24v3o8cl8aboxgu
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2009-12-07 20:29:45 +0000
message:
  (nmb) Use open-containing for 'bzr lp-open'
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/plugins/launchpad/__init__.py __init__.py-20060315182712-2d5feebd2a1032dc
  bzrlib/plugins/launchpad/test_lp_open.py test_lp_open.py-20090125174355-hxrsxh3sj84225qu-1
=== modified file 'NEWS'
--- a/NEWS	2009-12-07 10:38:09 +0000
+++ b/NEWS	2009-12-07 20:29:45 +0000
@@ -89,6 +89,10 @@
   passed to the external diff tool. This allows the file to be edited if the
   diff tool provides for this. (Gary van der Merwe, #490738)
   
+* The launchpad-open command can now be used from a subdirectory of a
+  branch, not just from the root of the branch. 
+  (Neil Martinsen-Burrell, #489102)
+
 
 Improvements
 ************

=== modified file 'bzrlib/plugins/launchpad/__init__.py'
--- a/bzrlib/plugins/launchpad/__init__.py	2009-10-30 14:44:52 +0000
+++ b/bzrlib/plugins/launchpad/__init__.py	2009-12-07 15:47:05 +0000
@@ -170,7 +170,7 @@
         """Yield possible external locations for the branch at 'location'."""
         yield location
         try:
-            branch = _mod_branch.Branch.open(location)
+            branch = _mod_branch.Branch.open_containing(location)[0]
         except NotBranchError:
             return
         branch_url = branch.get_public_branch()

=== modified file 'bzrlib/plugins/launchpad/test_lp_open.py'
--- a/bzrlib/plugins/launchpad/test_lp_open.py	2009-03-23 14:59:43 +0000
+++ b/bzrlib/plugins/launchpad/test_lp_open.py	2009-12-07 15:47:05 +0000
@@ -17,6 +17,7 @@
 """Tests for the launchpad-open command."""
 
 from bzrlib.tests import TestCaseWithTransport
+import os
 
 
 class TestLaunchpadOpen(TestCaseWithTransport):
@@ -87,3 +88,15 @@
             ['Opening https://code.edge.launchpad.net/~foo/bar/baz in web '
              'browser'],
             self.run_open('bzr+ssh://bazaar.launchpad.net/~foo/bar/baz'))
+
+    def test_launchpad_branch_subdirectory(self):
+        # lp-open in a subdirectory of a registered branch should work
+        wt = self.make_branch_and_tree('lp')
+        wt.branch.set_push_location(
+            'bzr+ssh://bazaar.launchpad.net/~foo/bar/baz')
+        self.build_tree(['lp/a/'])
+        os.chdir('lp/a')
+        self.assertEqual(
+            ['Opening https://code.edge.launchpad.net/~foo/bar/baz in web '
+             'browser'],
+            self.run_open('.'))




More information about the bazaar-commits mailing list