Commit d69dab94 authored by enne@chromium.org's avatar enne@chromium.org

Make my_activity.py robust to log parsing problems

If (hypothetically) you pointed your WebKit repo environment variable to
Blink and not WebKit, then the change_re will not find anything in the
log and the script will explode on changes[0] because changes=[].

Fix this by being robust to not being able to parse anything out of the
log in process_git_commits.

R=szager@chromium.org
BUG=none

Review URL: https://chromiumcodereview.appspot.com/16258010

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@205290 0039d316-1c4b-4281-b951-d872f2087c98
parent ff526198
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment