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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/master/svnpoller.py
===================================================================
--- scripts/master/svnpoller.py (revision 0)
+++ scripts/master/svnpoller.py (revision 0)
@@ -0,0 +1,46 @@
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+""" 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.
+
+from buildbot.changes import svnpoller
+
+class SVNPoller(svnpoller.SVNPoller):
+ def __init__(self):
+ 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.
+
+ 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.
+ args = []
+ args.extend(["log", "--xml", "--verbose", "--non-interactive",
+ "--with-all-revprops"])
+ if self.svnuser:
+ 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.
+ if self.svnpasswd:
+ args.extend(["--password=%s" % self.svnpasswd])
+ args.extend(["--limit=%d" % (self.histmax), self.svnurl])
+ d = self.getProcessOutput(args)
+ return d
+
+ 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.
+ def commit_bot_used(logentry):
+ revprops = logentry.getElementsByTagName('revprops')
+ if revprops is not None:
+ for revprop in revprops.getElementsByTagName('property'):
+ if revprop.getAttribute("name") == "commit-bot":
+ return True
+ return False
+
+ revcq = {}
+ for el in new_logentries:
+ if commit_bot_used(el):
+ revcq[str(el.getAttribute("revision"))] = True
+
+ 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.
+ for change in changes:
+ if change.revision in revcq:
+ change.cq = " (CQ)"
+ else:
+ change.cq = ""
+
+ return changes
Property changes on: scripts/master/svnpoller.py
___________________________________________________________________
Added: svn:eol-style
+ LF
« 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