~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to serve-branches

  • Committer: Jelmer Vernooij
  • Date: 2009-05-04 18:53:21 UTC
  • mto: This revision was merged to the branch mainline in revision 338.
  • Revision ID: jelmer@samba.org-20090504185321-fva5cwcf5lomtj7g
Use transports internally rather than local file system.

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
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 = UserBranchesFromFileSystemRoot(transport, config)
70
71
    else:
71
 
        app = BranchesFromFileSystemRoot(path, config)
 
72
        app = BranchesFromFileSystemRoot(transport, config)
72
73
 
73
74
    # setup_logging()
74
75
    logging.basicConfig()
134
135
    else:
135
136
        host = config.get_option('user_host')
136
137
 
137
 
    load_plugins()
138
 
 
139
138
    httpserver.serve(app, host=host, port=port)
140
139
 
141
140