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

Unified Diff: my_activity.py

Issue 16258010: Make my_activity.py robust to log parsing problems (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 7 years, 6 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 ac68a23a58de36bb6be6ee24c2e8c475f6003a03..4883cdf286517af40ddcccce94c5c2ff007400f8 100755
--- a/my_activity.py
+++ b/my_activity.py
@@ -573,7 +573,9 @@ class MyActivity(object):
output = self.git_cmd(repo, 'log', commit + "^!", "--format=%cn%n%cd%n%B")
author = output[0]
date = datetime.strptime(output[1], "%a %b %d %H:%M:%S %Y +0000")
- ret.append(self.process_git_commit(instance, author, date, output[2:]))
+ processed = self.process_git_commit(instance, author, date, output[2:])
+ if processed:
+ ret.append(processed)
ret = sorted(ret, key=lambda i: i['modified'], reverse=True)
return ret
@@ -614,8 +616,11 @@ class MyActivity(object):
url = 'http://%s/%d' % (instance['review_url'], reviews[0])
if instance['review_prop']:
ret[instance['review_prop']] = reviews[0]
- else:
+ elif len(changes) == 1:
url = 'http://%s/%d' % (instance['change_url'], changes[0])
+ else:
+ # Couldn't find anything.
+ return None
ret['review_url'] = url
return ret
« 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