Rev 6237: (jelmer) Support serving from URL in `bzr serve`. (Jelmer Vernooij) in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/

Patch Queue Manager pqm at pqm.ubuntu.com
Wed Nov 2 00:03:25 UTC 2011


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

------------------------------------------------------------
revno: 6237 [merge]
revision-id: pqm at pqm.ubuntu.com-20111102000324-ogs34omxu95ebikb
parent: pqm at pqm.ubuntu.com-20111027162033-86ykkus23jn9yw7g
parent: jelmer at samba.org-20111101230612-hfszas9v5bjannl0
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2011-11-02 00:03:24 +0000
message:
  (jelmer) Support serving from URL in `bzr serve`. (Jelmer Vernooij)
modified:
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
  bzrlib/tests/blackbox/test_serve.py test_serve.py-20060913064329-8t2pvmsikl4s3xhl-1
  doc/en/release-notes/bzr-2.5.txt bzr2.5.txt-20110708125756-587p0hpw7oke4h05-1
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2011-10-18 13:31:13 +0000
+++ b/bzrlib/builtins.py	2011-11-01 18:40:39 +0000
@@ -5349,10 +5349,10 @@
         if protocol is None:
             protocol = transport.transport_server_registry.get()
         host, port = self.get_host_and_port(port)
-        url = urlutils.local_path_to_url(directory)
+        url = transport.location_to_url(directory)
         if not allow_writes:
             url = 'readonly+' + url
-        t = transport.get_transport(url)
+        t = transport.get_transport_from_url(url)
         try:
             protocol(t, host, port, inet, client_timeout)
         except TypeError, e:

=== modified file 'bzrlib/tests/blackbox/test_serve.py'
--- a/bzrlib/tests/blackbox/test_serve.py	2011-10-12 16:00:13 +0000
+++ b/bzrlib/tests/blackbox/test_serve.py	2011-11-01 18:40:39 +0000
@@ -22,7 +22,6 @@
 import sys
 import thread
 import threading
-import time
 
 from bzrlib import (
     builtins,
@@ -442,3 +441,10 @@
         self.assertEqual(base_url, self.bzr_serve_transport.base)
         self.assertEqual(base_dir,
             server_maker.get_base_path(self.bzr_serve_transport))
+        # Read-only, from a URL
+        cmd.run(directory=base_url, protocol=capture_transport)
+        server_maker = BzrServerFactory()
+        self.assertEqual(
+            'readonly+%s' % base_url, self.bzr_serve_transport.base)
+        self.assertEqual(
+            base_dir, server_maker.get_base_path(self.bzr_serve_transport))

=== modified file 'doc/en/release-notes/bzr-2.5.txt'
--- a/doc/en/release-notes/bzr-2.5.txt	2011-10-27 15:14:04 +0000
+++ b/doc/en/release-notes/bzr-2.5.txt	2011-11-01 23:06:12 +0000
@@ -37,6 +37,10 @@
 * ``bzr revno`` now takes a ``--revision`` argument.
   (Jelmer Vernooij, #870649)
 
+* ``bzr serve`` now can serve from URLs rather than just from the
+  file system. I.e.: ``bzr serve -d lp:bzr`` or
+  ``bzr serve -d file:///data/bzr`` (Jelmer Vernooij)
+
 * all input prompts are now char-based when possible, and can be forced to
   line-based mode by setting the ``BZR_TEXTUI_INPUT`` environment variable
   to 'line-based'. This replace the previous shelf UI only patch using




More information about the bazaar-commits mailing list