Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: scripts/master/svnpoller.py

Issue 9169097: Add a custom SVNPoller implementation that adds " (CQ)" to author name for (Closed) Base URL: http://src.chromium.org/svn/trunk/tools/build/
Patch Set: . Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « masters/master.chromium.fyi/master.cfg ('k') | third_party/buildbot_8_4p1/README.chromium » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(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 from buildbot.changes import svnpoller
6
7 class SVNPoller(svnpoller.SVNPoller):
8 """Adds necessary information to add (CQ) tag to waterfall/console views."""
9
10 def get_logs(self, _):
11 """Uses an additional --with-all-revprops argument for svn log so that it
12 has necessary information to know whether a commit was made by the
13 commit-queue."""
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])
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):
26 """Adds a key 'cq' in each change dict. The value is set to ' (CQ)' if the
27 change was committed by the commit-queue."""
28 def commit_bot_used(logentry):
29 revprops = logentry.getElementsByTagName('revprops')
30 if revprops is not None:
31 for revprop in revprops.getElementsByTagName('property'):
32 if revprop.getAttribute("name") == "commit-bot":
33 return True
34 return False
35
36 revcq = {}
37 for el in new_logentries:
38 if commit_bot_used(el):
39 revcq[str(el.getAttribute("revision"))] = True
40
41 changes = svnpoller.SVNPoller.create_changes(self, new_logentries)
42 for change in changes:
43 if change.revision in revcq:
44 change['cq'] = " (CQ)"
45 else:
46 change['cq'] = ""
47
48 return changes
OLDNEW
« no previous file with comments | « masters/master.chromium.fyi/master.cfg ('k') | third_party/buildbot_8_4p1/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698