~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to bzrplugins/lpserve.py

  • Committer: Aaron Bentley
  • Date: 2008-01-21 05:44:15 UTC
  • mto: This revision was merged to the branch mainline in revision 5586.
  • Revision ID: aaron@canonical.com-20080121054415-zjklfqnpbqe25v81
Quicksave

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
__all__ = ['cmd_launchpad_server']
11
11
 
12
12
 
 
13
import os
13
14
import sys
14
15
import xmlrpclib
15
16
 
16
17
from bzrlib.commands import Command, register_command
17
18
from bzrlib.option import Option
18
19
from bzrlib import urlutils, ui
 
20
from bzrlib import trace
19
21
 
 
22
from bzrlib import plugin
20
23
from bzrlib.smart import medium, server
21
24
from bzrlib.transport import chroot, get_transport, remote
22
25
 
23
26
from canonical.config import config
24
 
from canonical.codehosting import transport
25
27
 
26
28
 
27
29
class cmd_launchpad_server(Command):
72
74
        :return: A `LaunchpadTransport`.
73
75
        """
74
76
        # XXX: JonathanLange 2007-05-29: The 'chroot' lines lack unit tests.
 
77
        from canonical.codehosting import transport
75
78
        hosted_transport = self._get_chrooted_transport(hosted_url)
76
79
        mirror_transport = self._get_chrooted_transport(mirror_url)
77
80
        lp_server = transport.LaunchpadServer(
112
115
 
113
116
    def run(self, user_id, port=None, upload_directory=None,
114
117
            mirror_directory=None, authserver_url=None, inet=False):
 
118
        from canonical.codehosting import transport
 
119
        try:
 
120
            os.unlink('/home/abentley/log')
 
121
        except:
 
122
            pass
 
123
        log = open('/home/abentley/log', 'w')
 
124
        print >> log, ('*!*!*!* ' + os.environ['BZR_PLUGIN_PATH'])
 
125
        print >> log, plugin.all_plugins()
 
126
        print >> log, 'BZR_HOME=%r' % os.environ.get('BZR_HOME')
 
127
        print >> log, 'HOME=%r' % os.environ.get('HOME')
 
128
        print >> log, '_log_file_name=%r' % (trace._bzr_log_filename,)
 
129
        log.flush()
 
130
        bzrlog = open(trace._bzr_log_filename)
 
131
        log.write(bzrlog.read())
 
132
        log.close()
115
133
        if upload_directory is None:
116
134
            upload_directory = config.codehosting.branches_root
117
135
        if mirror_directory is None: