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

Unified Diff: commit-queue/commit_queue.py

Issue 24303002: GTTF: changes that allow testing CQ locally (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | commit-queue/pending_manager.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: commit-queue/commit_queue.py
===================================================================
--- commit-queue/commit_queue.py (revision 223133)
+++ commit-queue/commit_queue.py (working copy)
@@ -58,40 +58,6 @@
return super(OnlyIssueRietveld, self).set_flag(issue, patchset, flag, value)
-class ReadOnlyRietveld(rietveld.Rietveld):
- def __init__(self, url, email, password, extra_headers, only_issue):
- super(ReadOnlyRietveld, self).__init__(url, email, password, extra_headers)
- self._only_issue = only_issue
- self._restricted = bool(only_issue)
-
- def _send(self, request_path, **kwargs):
- """Ignore all post requests."""
- if kwargs.get('payload'):
- logging.warn('Ignoring POST to %s', request_path)
- return
- return super(ReadOnlyRietveld, self)._send(request_path, **kwargs)
-
- def get_pending_issues(self):
- """If it's set to return a single issue, only return this one."""
- if self._restricted:
- if self._only_issue:
- return [self._only_issue]
- return []
- return super(ReadOnlyRietveld, self).get_pending_issues()
-
- def get_issue_properties(self, issue, messages):
- """Hacks the result to fake that the issue has the commit bit set."""
- data = super(ReadOnlyRietveld, self).get_issue_properties(issue, messages)
- if issue == self._only_issue:
- data['commit'] = True
- return data
-
- def set_flag(self, issue, patchset, flag, value):
- if issue == self._only_issue and flag == 'commit' and value == 'False':
- self._only_issue = None
- return super(ReadOnlyRietveld, self).set_flag(issue, patchset, flag, value)
-
-
class FakeCheckout(object):
def __init__(self):
self.project_path = os.getcwd()
@@ -100,7 +66,7 @@
@staticmethod
def prepare(_revision):
logging.info('FakeCheckout is syncing')
- return 'FAKE'
+ return unicode('FAKE')
iannucci 2013/09/20 23:42:53 u'FAKE' ? What is this fixing (I'm assuming somet
Paweł Hajdan Jr. 2013/09/21 01:40:27 It's fixing an exception that unicode is expected
@staticmethod
def apply_patch(*_args):
@@ -115,7 +81,11 @@
def get_settings(_key):
return None
+ @staticmethod
+ def revisions(*_args):
+ return None
+
def AlertOnUncleanCheckout():
"""Sends an alert if the cq is running live with local edits."""
diff = subprocess2.capture(['gclient', 'diff'], cwd=ROOT_DIR).strip()
@@ -219,18 +189,15 @@
if options.dry_run:
logging.debug('Dry run - skipping SCM check.')
if options.only_issue:
Isaac (away) 2013/09/21 09:32:49 How come we're blocking this case now? I think th
Paweł Hajdan Jr. 2013/09/24 02:40:43 Isaac, do you consider this blocking the CL or jus
- print(
- 'Using read-only Rietveld; using only issue %d' %
- options.only_issue)
+ parser.error('--only-issue is not supported with dry run')
else:
print('Using read-only Rietveld')
# Make sure rietveld is not modified.
- rietveld_obj = ReadOnlyRietveld(
+ rietveld_obj = rietveld.ReadOnlyRietveld(
url,
options.user,
gaia_creds.get(options.user),
- None,
- options.only_issue)
+ None)
else:
AlertOnUncleanCheckout()
print('WARNING: The Commit Queue is going to commit stuff')
« no previous file with comments | « no previous file | commit-queue/pending_manager.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698