1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 import sys
17 import traceback
18 from twisted.internet import defer
19 from buildbot.clients import sendchange as sendchange_client
20 from buildbot.util import in_reactor
21
22 @in_reactor
23 @defer.inlineCallbacks
24 -def sendchange(config):
25 encoding = config.get('encoding', 'utf8')
26 who = config.get('who')
27 auth = config.get('auth')
28 master = config.get('master')
29 branch = config.get('branch')
30 category = config.get('category')
31 revision = config.get('revision')
32 properties = config.get('properties', {})
33 repository = config.get('repository', '')
34 vc = config.get('vc', None)
35 project = config.get('project', '')
36 revlink = config.get('revlink', '')
37 when = config.get('when')
38 comments = config.get('comments')
39 files = config.get('files', ())
40 codebase = config.get('codebase', None)
41
42 s = sendchange_client.Sender(master, auth, encoding=encoding)
43 try:
44 yield s.send(branch, revision, comments, files, who=who,
45 category=category, when=when, properties=properties,
46 repository=repository, vc=vc, project=project, revlink=revlink,
47 codebase=codebase)
48 except:
49 print "change not sent:"
50 traceback.print_exc(file=sys.stdout)
51 defer.returnValue(1)
52 else:
53 print "change sent successfully"
54 defer.returnValue(0)
55