~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to serve-branches

  • Committer: Matt Nordhoff
  • Date: 2009-05-02 02:42:49 UTC
  • mfrom: (334.1.1 serve_public_branch)
  • Revision ID: mnordhoff@mattnordhoff.com-20090502024249-0hwrt4lv747j0poi
Use the branch's public_branch as the default for served_url (bug #369767)

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
24
23
 
25
24
from paste import httpserver
26
25
from paste.httpexceptions import HTTPExceptionHandler, HTTPInternalServerError
27
26
from paste.translogger import TransLogger
28
27
 
29
28
from loggerhead import __version__
30
 
from loggerhead.apps.transport import (
31
 
    BranchesFromTransportRoot, UserBranchesFromTransportRoot)
 
29
from loggerhead.apps.filesystem import (
 
30
    BranchesFromFileSystemRoot, UserBranchesFromFileSystemRoot)
32
31
from loggerhead.config import LoggerheadConfig
33
32
from loggerhead.util import Reloader
34
33
from loggerhead.apps.error import ErrorHandlerApp
49
48
    else:
50
49
        path = '.'
51
50
 
52
 
    load_plugins()
53
 
 
54
 
    transport = get_transport(path)
 
51
    if not os.path.isdir(path):
 
52
        print "%s is not a directory" % path
 
53
        sys.exit(1)
55
54
 
56
55
    if config.get_option('trunk_dir') and not config.get_option('user_dirs'):
57
56
        print "--trunk-dir is only valid with --user-dirs"
67
66
        if not config.get_option('trunk_dir'):
68
67
            print "You didn't specify a directory for the trunk directories."
69
68
            sys.exit(1)
70
 
        app = UserBranchesFromTransportRoot(transport, config)
 
69
        app = UserBranchesFromFileSystemRoot(path, config)
71
70
    else:
72
 
        app = BranchesFromTransportRoot(transport, config)
 
71
        app = BranchesFromFileSystemRoot(path, config)
73
72
 
74
73
    # setup_logging()
75
74
    logging.basicConfig()
135
134
    else:
136
135
        host = config.get_option('user_host')
137
136
 
 
137
    load_plugins()
 
138
 
138
139
    httpserver.serve(app, host=host, port=port)
139
140
 
140
141