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

Side by Side Diff: verification/committer_revert.py

Issue 23483019: Changes to support One-Click Revert in Commit Queue (Closed) Base URL: https://src.chromium.org/chrome/trunk/tools/commit-queue/
Patch Set: Created 7 years, 3 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
« no previous file with comments | « tests/try_server_test.py ('k') | no next file » | 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:executable
+ *
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 """The revert checkbox must be checked by a project committer."""
7
8
9 from verification import base
10
11 import re
12
13
14 class CommitterRevertStatus(base.SimpleStatus):
15
16 NO_COMMITTER = (
17 'Revert was not triggered by a project committer. Only full committers\n'
18 'are accepted.'
19 )
20
21 def __init__(self, pending, committers, **kwargs):
22 super(CommitterRevertStatus, self).__init__(**kwargs)
23 if pending:
24 self._check(pending, committers)
25
26 def _check(self, pending, committers):
27 """Updates self.state and self.error_message properties."""
28 if any(re.match(i, pending.reverted_by) for i in committers):
29 self.state = base.SUCCEEDED
30 else:
31 self.error_message = self.NO_COMMITTER
32 self.state = base.FAILED
33
34
35 class CommitterRevertVerifier(base.Verifier):
36 """The revert must be triggered by a project committer."""
37
38 name = 'committer_revert'
39
40 def __init__(self, committers):
41 super(CommitterRevertVerifier, self).__init__()
42 self.committers = committers
43
44 def verify(self, pending):
45 assert pending.revert
46 pending.verifications[self.name] = CommitterRevertStatus(
47 pending=pending, committers=self.committers)
48
49 def update_status(self, queue):
50 pass
OLDNEW
« no previous file with comments | « tests/try_server_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698