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

Unified Diff: PRESUBMIT.py

Issue 2307593002: Use methods from depot_tool's Changelist object instead of Rietveld RPC (Closed)
Patch Set: Remove TODO Created 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT.py
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 2611f83eb37b838cd3330072e07cf84e82179440..f25459e96a4beaf2539553cb679115bdff6ae1e7 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -462,9 +462,8 @@ def PostUploadHook(cl, change, output_api):
break
issue = cl.issue
- rietveld_obj = cl.RpcServer()
- if issue and rietveld_obj:
- original_description = rietveld_obj.get_description(issue)
+ if issue:
+ original_description = cl.GetDescription()
new_description = original_description
# Add GOLD_TRYBOT_URL if it does not exist yet.
@@ -499,9 +498,8 @@ def PostUploadHook(cl, change, output_api):
# If the target ref is not master then add NOTREECHECKS=true and NOTRY=true
# to the CL's description if it does not already exist there.
- target_ref = rietveld_obj.get_issue_properties(issue, False).get(
- 'target_ref', '')
- if target_ref != 'refs/heads/master':
+ target_ref = cl.GetRemoteBranch()[1]
+ if target_ref != 'refs/remotes/origin/master':
if not re.search(
r'^NOTREECHECKS=true$', new_description, re.M | re.I):
new_description += "\nNOTREECHECKS=true"
@@ -543,7 +541,7 @@ def PostUploadHook(cl, change, output_api):
# If the description has changed update it.
if new_description != original_description:
- rietveld_obj.update_description(issue, new_description)
+ cl.UpdateDescription(new_description)
return results
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698