~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to serve-branches

  • Committer: Matt Nordhoff
  • Date: 2009-05-18 05:16:38 UTC
  • Revision ID: mnordhoff@mattnordhoff.com-20090518051638-s4m1u3hd19ijtygv
Fix typo.

(At least it didn't actually break anything.)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import sys
21
21
 
22
22
from bzrlib.plugin import load_plugins
 
23
from bzrlib.transport import get_transport
23
24
 
24
25
from paste import httpserver
25
26
from paste.httpexceptions import HTTPExceptionHandler, HTTPInternalServerError
26
27
from paste.translogger import TransLogger
27
28
 
28
29
from loggerhead import __version__
29
 
from loggerhead.apps.filesystem import (
30
 
    BranchesFromFileSystemRoot, UserBranchesFromFileSystemRoot)
 
30
from loggerhead.apps.transport import (
 
31
    BranchesFromTransportRoot, UserBranchesFromTransportRoot)
31
32
from loggerhead.config import LoggerheadConfig
32
33
from loggerhead.util import Reloader
33
34
from loggerhead.apps.error import ErrorHandlerApp
48
49
    else:
49
50
        path = '.'
50
51
 
51
 
    if not os.path.isdir(path):
52
 
        print "%s is not a directory" % path
53
 
        sys.exit(1)
 
52
    load_plugins()
 
53
 
 
54
    transport = get_transport(path)
54
55
 
55
56
    if config.get_option('trunk_dir') and not config.get_option('user_dirs'):
56
57
        print "--trunk-dir is only valid with --user-dirs"
66
67
        if not config.get_option('trunk_dir'):
67
68
            print "You didn't specify a directory for the trunk directories."
68
69
            sys.exit(1)
69
 
        app = UserBranchesFromFileSystemRoot(path, config)
 
70
        app = UserBranchesFromTransportRoot(transport, config)
70
71
    else:
71
 
        app = BranchesFromFileSystemRoot(path, config)
 
72
        app = BranchesFromTransportRoot(transport, config)
72
73
 
73
74
    # setup_logging()
74
75
    logging.basicConfig()
86
87
    logfile.setLevel(logging.DEBUG)
87
88
    logger.addHandler(logfile)
88
89
 
89
 
    if config.get_option('memory_profile'):
90
 
        memprofile = logging.getLogger('loggerhead-memprofile')
91
 
        memprofile.setLevel(logging.DEBUG)
92
 
        memprofile.addHandler(logging.FileHandler('loggerhead-memprofile'))
93
 
 
94
90
    # setup_logging() #end
95
91
 
96
92
    app = TransLogger(app, logger=logger)
98
94
        from loggerhead.middleware.profile import LSProfMiddleware
99
95
        app = LSProfMiddleware(app)
100
96
    if config.get_option('memory_profile'):
101
 
        from loggerhead.middleware.profile import MemoryProfileMiddleware
102
 
        app = MemoryProfileMiddleware(app)
 
97
        from dozer import Dozer
 
98
        app = Dozer(app)
103
99
 
104
100
    if not config.get_option('user_prefix'):
105
101
        prefix = '/'
139
135
    else:
140
136
        host = config.get_option('user_host')
141
137
 
142
 
    load_plugins()
143
 
 
144
138
    httpserver.serve(app, host=host, port=port)
145
139
 
146
140