OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
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 executable. | 5 """Commit queue executable. |
6 | 6 |
7 Reuse Rietveld and the Chromium Try Server to process and automatically commit | 7 Reuse Rietveld and the Chromium Try Server to process and automatically commit |
8 patches. | 8 patches. |
9 """ | 9 """ |
10 | 10 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 maxBytes= 10*1024*1024, | 121 maxBytes= 10*1024*1024, |
122 backupCount=50) | 122 backupCount=50) |
123 logging_rotating_file.setLevel(logging.DEBUG) | 123 logging_rotating_file.setLevel(logging.DEBUG) |
124 logging_rotating_file.setFormatter(logging.Formatter( | 124 logging_rotating_file.setFormatter(logging.Formatter( |
125 '%(asctime)s %(levelname)-8s %(module)15s(%(lineno)4d): %(message)s')) | 125 '%(asctime)s %(levelname)-8s %(module)15s(%(lineno)4d): %(message)s')) |
126 logging.getLogger().addHandler(logging_rotating_file) | 126 logging.getLogger().addHandler(logging_rotating_file) |
127 | 127 |
128 | 128 |
129 class SignalInterrupt(Exception): | 129 class SignalInterrupt(Exception): |
130 """Exception that indicates being interrupted by a caught signal.""" | 130 """Exception that indicates being interrupted by a caught signal.""" |
131 | 131 |
132 def __init__(self, signal_set=None, *args, **kwargs): | 132 def __init__(self, signal_set=None, *args, **kwargs): |
133 super(SignalInterrupt, self).__init__(*args, **kwargs) | 133 super(SignalInterrupt, self).__init__(*args, **kwargs) |
134 self.signal_set = signal_set | 134 self.signal_set = signal_set |
135 | 135 |
136 | 136 |
137 def SaveDatabaseCopyForDebugging(db_path): | 137 def SaveDatabaseCopyForDebugging(db_path): |
138 """Saves database file for debugging. Returns name of the saved file.""" | 138 """Saves database file for debugging. Returns name of the saved file.""" |
139 with tempfile.NamedTemporaryFile( | 139 with tempfile.NamedTemporaryFile( |
140 dir=os.path.dirname(db_path), | 140 dir=os.path.dirname(db_path), |
141 prefix='db.debug.', | 141 prefix='db.debug.', |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 # CQ generally doesn't exit by itself, but if we ever get here, it looks | 388 # CQ generally doesn't exit by itself, but if we ever get here, it looks |
389 # like a clean shutdown so remove the landmine file. | 389 # like a clean shutdown so remove the landmine file. |
390 # TODO(phajdan.jr): Do we ever get here? | 390 # TODO(phajdan.jr): Do we ever get here? |
391 os.remove(landmine_path) | 391 os.remove(landmine_path) |
392 return 0 | 392 return 0 |
393 | 393 |
394 | 394 |
395 if __name__ == '__main__': | 395 if __name__ == '__main__': |
396 fix_encoding.fix_encoding() | 396 fix_encoding.fix_encoding() |
397 sys.exit(main()) | 397 sys.exit(main()) |
OLD | NEW |