1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
#!/usr/bin/python2.4
# Copyright 2006 Canonical Ltd. All rights reserved.
import _pythonpath
from optparse import OptionParser
from canonical.config import config
from canonical.launchpad.scripts import logger_options, logger
from canonical.launchpad.scripts.supermirror import mirror, jobmanager
import bzrlib.repository
def shut_up_deprecation_warning():
# XXX: quick hack to disable the deprecation warning for old repository
# formats -- DavidAllouche 2006-01-29
bzrlib.repository._deprecation_warning_done = True
if __name__ == '__main__':
parser = OptionParser()
logger_options(parser)
(options, arguments) = parser.parse_args()
which = arguments.pop(0)
if arguments:
parser.error("Unhandled arguments %s" % repr(arguments))
if which == 'upload':
errorreports = config.supermirror.upload_errorreports
manager_class = jobmanager.UploadJobManager
elif which == 'import':
errorreports = config.supermirror.import_errorreports
manager_class = jobmanager.ImportJobManager
elif which == 'mirror':
errorreports = config.supermirror.mirror_errorreports
manager_class = jobmanager.MirrorJobManager
else:
parser.error(
"Expected 'upload', 'import' or 'mirror', but got: %r" % which)
# Customize the oops reporting config.
config.launchpad.errorreports.oops_prefix = errorreports.oops_prefix
config.launchpad.errorreports.errordir = errorreports.errordir
config.launchpad.errorreports.copy_to_zlog = errorreports.copy_to_zlog
log = logger(options, 'branch-puller')
shut_up_deprecation_warning()
mirror(log, manager_class)
|