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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/common/net/rietveld.py

Issue 2129733002: Add get_issue_number function to webkitpy/common/checkout/scm/git.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Tools/Scripts/webkitpy/common/net/rietveld.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/rietveld.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/rietveld.py
index 5b9b1a8ae438d02886d09fb858b88ab52c20ccbc..4a288e4752de6b67f5042f0a8449698b9781f2a7 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/rietveld.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/rietveld.py
@@ -8,7 +8,7 @@ import collections
import json
import logging
import urllib2
-
+import subprocess
_log = logging.getLogger(__name__)
@@ -73,8 +73,10 @@ def _get_json(url, web):
def _issue_url(issue_number):
- return '%s/%s' % (BASE_CODEREVIEW_URL, issue_number)
-
+ if issue_number == 'None':
+ raise Exception('No issue number associated with this branch')
+ else:
Dirk Pranke 2016/07/06 21:22:37 I would enforce that the issue_number is legit as
+ return '%s/%s' % (BASE_CODEREVIEW_URL, issue_number)
def _patchset_url(issue_number, patchset_number):
return '%s/%s' % (_issue_url(issue_number), patchset_number)
@@ -87,3 +89,9 @@ def get_latest_try_job_results(issue_number, web):
for job in patchset_data['try_job_results']:
results[job['builder']] = job['result']
return results
+
+
+def get_cl_issue_number():
Dirk Pranke 2016/07/06 21:22:37 This method doesn't belong on this object, since y
qyearsley 2016/07/06 21:38:56 1. In other places in webkitpy, an Executive objec
dcampb 2016/07/06 22:13:06 per dpranke@ comment, I moved the function to the
Dirk Pranke 2016/07/06 22:33:29 Actually mocking all of that stuff up in scm_unitt
+ issue_number = subprocess.check_output('git cl issue | cut -d" " -f3', shell=True)
qyearsley 2016/07/06 21:38:56 As I think you mentioned, this command using `cut`
+ issue_number = issue_number[:-1]
+ return issue_number
« 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