Chromium Code Reviews| 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 |