~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to __init__.py

[rs=me] update to loggerhead trunk to get the possible fix for 118625

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
starts a web server to browse the contents of a branch.
31
31
"""
32
32
 
33
 
version_info = (1, 11, 0)
 
33
version_info = (1, 17, 0)
34
34
 
35
35
if __name__ == 'bzrlib.plugins.loggerhead':
36
36
    import bzrlib
37
37
    from bzrlib.api import require_any_api
38
38
 
39
 
    require_any_api(bzrlib, [(1, 13, 0), (1, 15, 0), (1, 16, 0), (1, 17, 0)])
 
39
    require_any_api(bzrlib, [
 
40
        (1, 13, 0), (1, 15, 0), (1, 16, 0), (1, 17, 0), (1, 18, 0),
 
41
        (2, 0, 0), (2, 1, 0)])
40
42
 
41
43
    # NB: Normally plugins should lazily load almost everything, but this
42
44
    # seems reasonable to have in-line here: bzrlib.commands and options are
57
59
            (DEFAULT_PORT,))
58
60
 
59
61
    def serve_http(transport, host=None, port=None, inet=None):
 
62
        from paste.httpexceptions import HTTPExceptionHandler
 
63
        from paste.httpserver import serve
 
64
 
60
65
        # loggerhead internal code will try to 'import loggerhead', so
61
66
        # let's put it on the path if we can't find it in the existing path
62
67
        try:
67
72
 
68
73
        from loggerhead.apps.transport import BranchesFromTransportRoot
69
74
        from loggerhead.config import LoggerheadConfig
70
 
        from paste.httpexceptions import HTTPExceptionHandler
71
 
        from paste.httpserver import serve
 
75
 
72
76
        if host is None:
73
77
            host = DEFAULT_HOST
74
78
        if port is None:
77
81
        if not transport.is_readonly():
78
82
            argv.insert(0, '--allow-writes')
79
83
        config = LoggerheadConfig(argv)
80
 
        app = BranchesFromTransportRoot(transport, config)
 
84
        app = BranchesFromTransportRoot(transport.base, config)
81
85
        app = HTTPExceptionHandler(app)
82
86
        serve(app, host=host, port=port)
83
87