|
OLD | NEW |
---|---|
(Empty) | |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 # Use of this source code is governed by a BSD-style license that can be | |
3 # found in the LICENSE file. | |
4 | |
5 """ Source file for buildbot.changes.svnpoller module modifications. """ | |
M-A Ruel
2012/01/26 20:30:55
Not really informative. Add a class docstring """A
sadrul
2012/01/26 20:45:18
Done.
| |
6 | |
7 from buildbot.changes import svnpoller | |
8 | |
9 class SVNPoller(svnpoller.SVNPoller): | |
10 def __init__(self): | |
11 self.old_create_changes = self.create_changes | |
M-A Ruel
2012/01/26 20:30:55
Remove.
sadrul
2012/01/26 20:45:18
Done.
| |
12 | |
13 def get_logs(self, _): | |
M-A Ruel
2012/01/26 20:30:55
Add a single line docstring explaining why the cha
sadrul
2012/01/26 20:45:18
Done.
| |
14 args = [] | |
15 args.extend(["log", "--xml", "--verbose", "--non-interactive", | |
16 "--with-all-revprops"]) | |
17 if self.svnuser: | |
18 args.extend(["--username=%s" % self.svnuser]) | |
M-A Ruel
2012/01/26 20:30:55
Align at +2. Yeah it's confusing...
sadrul
2012/01/26 20:45:18
Done.
| |
19 if self.svnpasswd: | |
20 args.extend(["--password=%s" % self.svnpasswd]) | |
21 args.extend(["--limit=%d" % (self.histmax), self.svnurl]) | |
22 d = self.getProcessOutput(args) | |
23 return d | |
24 | |
25 def create_changes(self, new_logentries): | |
M-A Ruel
2012/01/26 20:30:55
Add a single line docstring explaining why the cha
sadrul
2012/01/26 20:45:18
Done.
| |
26 def commit_bot_used(logentry): | |
27 revprops = logentry.getElementsByTagName('revprops') | |
28 if revprops is not None: | |
29 for revprop in revprops.getElementsByTagName('property'): | |
30 if revprop.getAttribute("name") == "commit-bot": | |
31 return True | |
32 return False | |
33 | |
34 revcq = {} | |
35 for el in new_logentries: | |
36 if commit_bot_used(el): | |
37 revcq[str(el.getAttribute("revision"))] = True | |
38 | |
39 changes = self.old_create_changes(new_logentries) | |
M-A Ruel
2012/01/26 20:30:55
changes = svnpoller.SVNPoller.create_changes(self,
sadrul
2012/01/26 20:45:18
Nice! Done.
| |
40 for change in changes: | |
41 if change.revision in revcq: | |
42 change.cq = " (CQ)" | |
43 else: | |
44 change.cq = "" | |
45 | |
46 return changes | |
OLD | NEW |