/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

Move SmartTCPServer to smart/server.py, and SmartServerRequestHandler to smart/request.py.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2894
2894
        ]
2895
2895
 
2896
2896
    def run(self, port=None, inet=False, directory=None, allow_writes=False):
2897
 
        from bzrlib.transport import smart
 
2897
        from bzrlib.transport.smart import medium, server
2898
2898
        from bzrlib.transport import get_transport
2899
2899
        if directory is None:
2900
2900
            directory = os.getcwd()
2903
2903
            url = 'readonly+' + url
2904
2904
        t = get_transport(url)
2905
2905
        if inet:
2906
 
            server = smart.SmartServerPipeStreamMedium(sys.stdin, sys.stdout, t)
 
2906
            smart_server = medium.SmartServerPipeStreamMedium(
 
2907
                sys.stdin, sys.stdout, t)
2907
2908
        elif port is not None:
2908
2909
            if ':' in port:
2909
2910
                host, port = port.split(':')
2910
2911
            else:
2911
2912
                host = '127.0.0.1'
2912
 
            server = smart.SmartTCPServer(t, host=host, port=int(port))
 
2913
            smart_server = server.SmartTCPServer(t, host=host, port=int(port))
2913
2914
            print 'listening on port: ', server.port
2914
2915
            sys.stdout.flush()
2915
2916
        else:
2916
 
            raise errors.BzrCommandError("bzr serve requires one of --inet or --port")
2917
 
        server.serve()
 
2917
            raise errors.BzrCommandError(
 
2918
                "bzr serve requires one of --inet or --port")
 
2919
        smart_server.serve()
2918
2920
 
2919
2921
 
2920
2922
# command-line interpretation helper for merge-related commands