aboutsummaryrefslogtreecommitdiffhomepage
path: root/PRESUBMIT.py
diff options
context:
space:
mode:
authorGravatar rmistry <rmistry@google.com>2016-09-01 09:52:32 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-01 09:52:32 -0700
commitb9a9e8788fdec6607b2fb95194c9821b99c4fbc9 (patch)
tree35ad209d395e309eebc35c0bfc1e502ce3f9dbfc /PRESUBMIT.py
parentbb35a6aa2d4033a7aa50355558152fe647bc6fa5 (diff)
Use methods from depot_tool's Changelist object instead of Rietveld RPC
This will make support for both Gerrit and Rietveld easier. BUG=skia:5676 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2307593002 NOTRY=true Review-Url: https://codereview.chromium.org/2307593002
Diffstat (limited to 'PRESUBMIT.py')
-rw-r--r--PRESUBMIT.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 2611f83eb3..f25459e96a 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