Rev 6461: (jelmer) Fix 'bzr send' in a treeless branch. (Jelmer Vernooij) in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/2.5/

Patch Queue Manager pqm at pqm.ubuntu.com
Fri Jan 27 14:01:27 UTC 2012


At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/2.5/

------------------------------------------------------------
revno: 6461 [merge]
revision-id: pqm at pqm.ubuntu.com-20120127140125-211qctcknarkf9w8
parent: pqm at pqm.ubuntu.com-20120127133353-roaqncvkncz1m2oi
parent: jelmer at samba.org-20120125155318-pnxvhethlrfhyr02
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: 2.5
timestamp: Fri 2012-01-27 14:01:25 +0000
message:
  (jelmer) Fix 'bzr send' in a treeless branch. (Jelmer Vernooij)
modified:
  bzrlib/controldir.py           controldir.py-20100802102926-hvtvh0uae5epuibp-1
  bzrlib/send.py                 send.py-20090521192735-j7cdb33ykmtmzx4w-1
  bzrlib/tests/blackbox/test_send.py test_bundle.py-20060616222707-c21c8b7ea5ef57b1
  doc/en/release-notes/bzr-2.5.txt bzr2.5.txt-20110708125756-587p0hpw7oke4h05-1
=== modified file 'bzrlib/controldir.py'
--- a/bzrlib/controldir.py	2012-01-27 13:33:53 +0000
+++ b/bzrlib/controldir.py	2012-01-27 14:01:25 +0000
@@ -778,7 +778,8 @@
         return controldir._get_tree_branch()
 
     @classmethod
-    def open_containing_tree_or_branch(klass, location):
+    def open_containing_tree_or_branch(klass, location,
+            possible_transports=None):
         """Return the branch and working tree contained by a location.
 
         Returns (tree, branch, relpath).
@@ -787,7 +788,8 @@
         raised
         relpath is the portion of the path that is contained by the branch.
         """
-        controldir, relpath = klass.open_containing(location)
+        controldir, relpath = klass.open_containing(location,
+            possible_transports=possible_transports)
         tree, branch = controldir._get_tree_branch()
         return tree, branch, relpath
 

=== modified file 'bzrlib/send.py'
--- a/bzrlib/send.py	2012-01-04 17:12:42 +0000
+++ b/bzrlib/send.py	2012-01-25 15:53:18 +0000
@@ -41,9 +41,9 @@
 def send(target_branch, revision, public_branch, remember,
          format, no_bundle, no_patch, output, from_, mail_to, message, body,
          to_file, strict=None):
+    possible_transports = []
     tree, branch = controldir.ControlDir.open_containing_tree_or_branch(
-        from_)[:2]
-    possible_transports = [tree.bzrdir.transport, branch.bzrdir.transport]
+        from_, possible_transports=possible_transports)[:2]
     # we may need to write data into branch's repository to calculate
     # the data to send.
     branch.lock_write()

=== modified file 'bzrlib/tests/blackbox/test_send.py'
--- a/bzrlib/tests/blackbox/test_send.py	2012-01-04 17:12:42 +0000
+++ b/bzrlib/tests/blackbox/test_send.py	2012-01-25 15:53:18 +0000
@@ -24,6 +24,7 @@
     merge_directive,
     tests,
     )
+from bzrlib.controldir import ControlDir
 from bzrlib.bundle import serializer
 from bzrlib.transport import memory
 from bzrlib.tests import (
@@ -330,6 +331,10 @@
         super(TestSendStrictWithoutChanges, self).setUp()
         self.make_parent_and_local_branches()
 
+    def test_send_without_workingtree(self):
+        ControlDir.open("local").destroy_workingtree()
+        self.assertSendSucceeds([])
+
     def test_send_default(self):
         self.assertSendSucceeds([])
 

=== modified file 'doc/en/release-notes/bzr-2.5.txt'
--- a/doc/en/release-notes/bzr-2.5.txt	2012-01-27 13:33:53 +0000
+++ b/doc/en/release-notes/bzr-2.5.txt	2012-01-27 14:01:25 +0000
@@ -50,6 +50,9 @@
 * ``bzr branch`` generates correct target branch locations again if not
   specified. (Jelmer Vernooij, #919218)
 
+* ``bzr send`` works on treeless branches again.
+  (Jelmer Vernooij, #921591)
+
 * Support scripts that don't call bzrlib.initialize() but still call run_bzr().
   (Vincent Ladeuil, #917733)
 




More information about the bazaar-commits mailing list