OLD | NEW |
1 # coding=utf8 | 1 # coding=utf8 |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 """Commit queue manager class. | 5 """Commit queue manager class. |
6 | 6 |
7 Security implications: | 7 Security implications: |
8 | 8 |
9 The following hypothesis are made: | 9 The following hypothesis are made: |
10 - Commit queue: | 10 - Commit queue: |
(...skipping 27 matching lines...) Expand all Loading... |
38 patchset = int | 38 patchset = int |
39 description = unicode | 39 description = unicode |
40 files = list | 40 files = list |
41 # Only a cache, these values can be regenerated. | 41 # Only a cache, these values can be regenerated. |
42 owner = unicode | 42 owner = unicode |
43 reviewers = list | 43 reviewers = list |
44 base_url = unicode | 44 base_url = unicode |
45 messages = list | 45 messages = list |
46 relpath = unicode | 46 relpath = unicode |
47 # Only used after a patch was committed. Keeping here for try job retries. | 47 # Only used after a patch was committed. Keeping here for try job retries. |
48 revision = (None, int, unicode) | 48 revision = (None, int, unicode, str) |
49 | 49 |
50 def __init__(self, **kwargs): | 50 def __init__(self, **kwargs): |
51 super(PendingCommit, self).__init__(**kwargs) | 51 super(PendingCommit, self).__init__(**kwargs) |
52 for message in self.messages: | 52 for message in self.messages: |
53 # Save storage, no verifier really need 'text', just 'approval'. | 53 # Save storage, no verifier really need 'text', just 'approval'. |
54 if 'text' in message: | 54 if 'text' in message: |
55 del message['text'] | 55 del message['text'] |
56 | 56 |
57 def pending_name(self): | 57 def pending_name(self): |
58 """The name that should be used for try jobs. | 58 """The name that should be used for try jobs. |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 """Loads the commit queue state from a JSON file.""" | 542 """Loads the commit queue state from a JSON file.""" |
543 self.queue = model.load_from_json_file(filename) | 543 self.queue = model.load_from_json_file(filename) |
544 | 544 |
545 def save(self, filename): | 545 def save(self, filename): |
546 """Save the commit queue state in a simple JSON file.""" | 546 """Save the commit queue state in a simple JSON file.""" |
547 model.save_to_json_file(filename, self.queue) | 547 model.save_to_json_file(filename, self.queue) |
548 | 548 |
549 def close(self): | 549 def close(self): |
550 """Close all the active pending manager items.""" | 550 """Close all the active pending manager items.""" |
551 self.context.status.close() | 551 self.context.status.close() |
OLD | NEW |