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

Unified Diff: git_cl.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | rietveld.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index 3c7cd3f315fac72e94414960910bbf7e16104d24..ab79f6235d82a3c0a0549fd4b8a3ceb75097194e 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -1737,12 +1737,18 @@ class _RietveldChangelistImpl(_ChangelistCodereviewBase):
return self.RpcServer().close_issue(self.GetIssue())
def SetFlag(self, flag, value):
- """Patchset must match."""
+ return self.SetFlags({flag: value})
+
+ def SetFlags(self, flags):
+ """Sets flags on this CL/patchset in Rietveld.
+
+ The latest patchset in Rietveld must be the same as latest known locally.
+ """
if not self.GetPatchset():
DieWithError('The patchset needs to match. Send another patchset.')
try:
- return self.RpcServer().set_flag(
- self.GetIssue(), self.GetPatchset(), flag, value)
+ return self.RpcServer().set_flags(
+ self.GetIssue(), self.GetPatchset(), flags)
except urllib2.HTTPError as e:
if e.code == 404:
DieWithError('The issue %s doesn\'t exist.' % self.GetIssue())
@@ -1791,9 +1797,10 @@ class _RietveldChangelistImpl(_ChangelistCodereviewBase):
if new_state == _CQState.COMMIT:
self.SetFlag('commit', '1')
elif new_state == _CQState.NONE:
- self.SetFlag('commit', '0')
+ self.SetFlags({'commit': '0', 'cq_dry_run': '0'})
else:
- raise NotImplementedError()
+ assert new_state == _CQState.DRY_RUN
+ self.SetFlags({'commit': '1', 'cq_dry_run': '1'})
def CMDPatchWithParsedIssue(self, parsed_issue_arg, reject, nocommit,
« no previous file with comments | « no previous file | rietveld.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698