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

Unified Diff: my_activity.py

Issue 23477012: my_activity: Add support for short URLs on gerrit. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 7 years, 4 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: my_activity.py
diff --git a/my_activity.py b/my_activity.py
index 4883cdf286517af40ddcccce94c5c2ff007400f8..16d3f7dba4770c620b381233818d5651d2bc88e8 100755
--- a/my_activity.py
+++ b/my_activity.py
@@ -118,10 +118,12 @@ gerrit_instances = [
{
'url': 'gerrit.chromium.org',
'port': 29418,
+ 'shorturl': 'crosreview.com',
},
{
'url': 'gerrit-int.chromium.org',
'port': 29419,
+ 'shorturl': 'crosreview.com/i',
},
]
@@ -394,15 +396,18 @@ class MyActivity(object):
issues = map(json.loads, issues)
# TODO(cjhopman): should we filter abandoned changes?
- issues = map(self.process_gerrit_issue, issues)
+ issues = [self.process_gerrit_issue(instance, issue) for issue in issues]
issues = filter(self.filter_issue, issues)
issues = sorted(issues, key=lambda i: i['modified'], reverse=True)
return issues
- def process_gerrit_issue(self, issue):
+ def process_gerrit_issue(self, instance, issue):
ret = {}
ret['review_url'] = issue['url']
+ if 'shorturl' in instance:
+ ret['review_url'] = 'http://%s/%s' % (instance['shorturl'],
+ issue['number'])
ret['header'] = issue['subject']
ret['owner'] = issue['owner']['email']
ret['author'] = ret['owner']
« 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