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

Side by Side Diff: rietveld.py

Issue 10963013: Do not enforce HEAD when a revision is not specified. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « git_cl.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')
OLDNEW
1 # coding: utf-8 1 # coding: utf-8
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 """Defines class Rietveld to easily access a rietveld instance. 5 """Defines class Rietveld to easily access a rietveld instance.
6 6
7 Security implications: 7 Security implications:
8 8
9 The following hypothesis are made: 9 The following hypothesis are made:
10 - Rietveld enforces: 10 - Rietveld enforces:
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 self, issue, patchset, reason, clobber, revision, builders_and_tests): 308 self, issue, patchset, reason, clobber, revision, builders_and_tests):
309 """Requests new try jobs. 309 """Requests new try jobs.
310 310
311 |builders_and_tests| is a map of builders: [tests] to run. 311 |builders_and_tests| is a map of builders: [tests] to run.
312 312
313 Returns the keys of the new TryJobResult entites. 313 Returns the keys of the new TryJobResult entites.
314 """ 314 """
315 params = [ 315 params = [
316 ('reason', reason), 316 ('reason', reason),
317 ('clobber', 'True' if clobber else 'False'), 317 ('clobber', 'True' if clobber else 'False'),
318 ('revision', revision if revision else 'HEAD'),
319 ('builders', json.dumps(builders_and_tests)), 318 ('builders', json.dumps(builders_and_tests)),
320 ('xsrf_token', self.xsrf_token()), 319 ('xsrf_token', self.xsrf_token()),
321 ] 320 ]
321 if revision:
322 params.append(('revision', revision))
322 return self.post('/%d/try/%d' % (issue, patchset), params) 323 return self.post('/%d/try/%d' % (issue, patchset), params)
323 324
324 def get_pending_try_jobs(self, cursor=None, limit=100): 325 def get_pending_try_jobs(self, cursor=None, limit=100):
325 """Retrieves the try job requests in pending state. 326 """Retrieves the try job requests in pending state.
326 327
327 Returns a tuple of the list of try jobs and the cursor for the next request. 328 Returns a tuple of the list of try jobs and the cursor for the next request.
328 """ 329 """
329 url = '/get_pending_try_patchsets?limit=%d' % limit 330 url = '/get_pending_try_patchsets?limit=%d' % limit
330 extra = ('&cursor=' + cursor) if cursor else '' 331 extra = ('&cursor=' + cursor) if cursor else ''
331 data = json.loads(self.get(url + extra)) 332 data = json.loads(self.get(url + extra))
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 if not 'Name or service not known' in e.reason: 374 if not 'Name or service not known' in e.reason:
374 # Usually internal GAE flakiness. 375 # Usually internal GAE flakiness.
375 raise 376 raise
376 # If reaching this line, loop again. Uses a small backoff. 377 # If reaching this line, loop again. Uses a small backoff.
377 time.sleep(1+maxtries*2) 378 time.sleep(1+maxtries*2)
378 finally: 379 finally:
379 upload.ErrorExit = old_error_exit 380 upload.ErrorExit = old_error_exit
380 381
381 # DEPRECATED. 382 # DEPRECATED.
382 Send = get 383 Send = get
OLDNEW
« no previous file with comments | « git_cl.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698