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

Side by Side Diff: rietveld.py

Issue 2127633003: Implement git cl set-commit --dry-run for Rietveld. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: be consistent Created 4 years, 5 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 | « 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 ('patchset', str(patchset)), 271 ('patchset', str(patchset)),
272 ('patch', str(patchid)), 272 ('patch', str(patchid)),
273 ('lineno', str(lineno))]) 273 ('lineno', str(lineno))])
274 274
275 def set_flag(self, issue, patchset, flag, value): 275 def set_flag(self, issue, patchset, flag, value):
276 return self.post('/%d/edit_flags' % issue, [ 276 return self.post('/%d/edit_flags' % issue, [
277 ('last_patchset', str(patchset)), 277 ('last_patchset', str(patchset)),
278 ('xsrf_token', self.xsrf_token()), 278 ('xsrf_token', self.xsrf_token()),
279 (flag, str(value))]) 279 (flag, str(value))])
280 280
281 def set_flags(self, issue, patchset, flags):
282 return self.post('/%d/edit_flags' % issue, [
283 ('last_patchset', str(patchset)),
284 ('xsrf_token', self.xsrf_token()),
285 ] + [(flag, str(value)) for flag, value in flags.iteritems()])
286
281 def search( 287 def search(
282 self, 288 self,
283 owner=None, reviewer=None, 289 owner=None, reviewer=None,
284 base=None, 290 base=None,
285 closed=None, private=None, commit=None, 291 closed=None, private=None, commit=None,
286 created_before=None, created_after=None, 292 created_before=None, created_after=None,
287 modified_before=None, modified_after=None, 293 modified_before=None, modified_after=None,
288 per_request=None, keys_only=False, 294 per_request=None, keys_only=False,
289 with_messages=False): 295 with_messages=False):
290 """Yields search results.""" 296 """Yields search results."""
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 message, 743 message,
738 add_as_reviewer=False): 744 add_as_reviewer=False):
739 logging.info('ReadOnlyRietveld: posting comment "%s" to issue %d' % 745 logging.info('ReadOnlyRietveld: posting comment "%s" to issue %d' %
740 (message, issue)) 746 (message, issue))
741 747
742 def set_flag(self, issue, patchset, flag, value): # pylint:disable=R0201 748 def set_flag(self, issue, patchset, flag, value): # pylint:disable=R0201
743 logging.info('ReadOnlyRietveld: setting flag "%s" to "%s" for issue %d' % 749 logging.info('ReadOnlyRietveld: setting flag "%s" to "%s" for issue %d' %
744 (flag, value, issue)) 750 (flag, value, issue))
745 ReadOnlyRietveld._local_changes.setdefault(issue, {})[flag] = value 751 ReadOnlyRietveld._local_changes.setdefault(issue, {})[flag] = value
746 752
753 def set_flags(self, issue, patchset, flags):
754 for flag, value in flags.iteritems():
755 self.set_flag(issue, patchset, flag, value)
756
747 def trigger_try_jobs( # pylint:disable=R0201 757 def trigger_try_jobs( # pylint:disable=R0201
748 self, issue, patchset, reason, clobber, revision, builders_and_tests, 758 self, issue, patchset, reason, clobber, revision, builders_and_tests,
749 master=None, category='cq'): 759 master=None, category='cq'):
750 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % 760 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' %
751 (builders_and_tests, issue)) 761 (builders_and_tests, issue))
752 762
753 def trigger_distributed_try_jobs( # pylint:disable=R0201 763 def trigger_distributed_try_jobs( # pylint:disable=R0201
754 self, issue, patchset, reason, clobber, revision, masters, 764 self, issue, patchset, reason, clobber, revision, masters,
755 category='cq'): 765 category='cq'):
756 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % 766 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' %
757 (masters, issue)) 767 (masters, issue))
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