Rev 2188: Fix cmd_serve. in sftp://bazaar.launchpad.net/%7Ebzr/bzr/hpss/

Andrew Bennetts andrew.bennetts at canonical.com
Thu Mar 29 03:53:52 BST 2007


At sftp://bazaar.launchpad.net/%7Ebzr/bzr/hpss/

------------------------------------------------------------
revno: 2188
revision-id: andrew.bennetts at canonical.com-20070329025245-8wdjghnbgjcp9mxy
parent: robertc at robertcollins.net-20070329023848-b6v5memfil1qq3uq
committer: Andrew Bennetts <andrew.bennetts at canonical.com>
branch nick: hpss
timestamp: Thu 2007-03-29 12:52:45 +1000
message:
  Fix cmd_serve.
modified:
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2007-03-27 21:45:59 +0000
+++ b/bzrlib/builtins.py	2007-03-29 02:52:45 +0000
@@ -3223,18 +3223,22 @@
     def run(self, port=None, inet=False, directory=None, allow_writes=False):
         from bzrlib.smart import medium, server
         from bzrlib.transport import get_transport
+        from bzrlib.transport.chroot import ChrootServer
+        from bzrlib.transport.remote import BZR_DEFAULT_PORT
         if directory is None:
             directory = os.getcwd()
         url = urlutils.local_path_to_url(directory)
         if not allow_writes:
             url = 'readonly+' + url
-        t = get_transport(url)
+        chroot_server = ChrootServer(get_transport(url))
+        chroot_server.setUp()
+        t = get_transport(chroot_server.get_url())
         if inet:
-            smart_server = smart.SmartServerPipeStreamMedium(
+            smart_server = medium.SmartServerPipeStreamMedium(
                 sys.stdin, sys.stdout, t)
         else:
             if port is None:
-                port = smart.BZR_DEFAULT_PORT
+                port = BZR_DEFAULT_PORT
                 host = '127.0.0.1'
             else:
                 if ':' in port:
@@ -3242,7 +3246,7 @@
                 else:
                     host = '127.0.0.1'
                 port = int(port)
-            smart_server = smart.SmartTCPServer(t, host=host, port=port)
+            smart_server = server.SmartTCPServer(t, host=host, port=port)
             print 'listening on port: ', smart_server.port
             sys.stdout.flush()
         # for the duration of this server, no UI output is permitted.




More information about the bazaar-commits mailing list