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

Side by Side Diff: appengine/findit/libs/gitiles/commit_util.py

Issue 2538373003: [Culprit-Finder] Merge lib/ to libs/. (Closed)
Patch Set: . Created 4 years 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 unified diff | Download patch
« no previous file with comments | « appengine/findit/libs/gitiles/change_log.py ('k') | appengine/findit/libs/gitiles/diff.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import re 5 import re
6 6
7 CODE_REVIEW_URL_PATTERN = re.compile( 7 CODE_REVIEW_URL_PATTERN = re.compile(
8 '^(?:Review URL|Review-Url): (.*\d+).*$', re.IGNORECASE) 8 '^(?:Review URL|Review-Url): (.*\d+).*$', re.IGNORECASE)
9 COMMIT_POSITION_PATTERN = re.compile( 9 COMMIT_POSITION_PATTERN = re.compile(
10 '^Cr-Commit-Position: refs/heads/master@{#(\d+)}$', re.IGNORECASE) 10 '^Cr-Commit-Position: refs/heads/master@{#(\d+)}$', re.IGNORECASE)
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 """Parse message to get the reverted revision if there is one.""" 62 """Parse message to get the reverted revision if there is one."""
63 lines = message.strip().splitlines() 63 lines = message.strip().splitlines()
64 if not lines[0].lower().startswith('revert'): 64 if not lines[0].lower().startswith('revert'):
65 return None 65 return None
66 66
67 for line in reversed(lines): # pragma: no cover 67 for line in reversed(lines): # pragma: no cover
68 # TODO: Handle cases where no reverted_revision in reverting message. 68 # TODO: Handle cases where no reverted_revision in reverting message.
69 reverted_revision_match = REVERTED_REVISION_PATTERN.match(line) 69 reverted_revision_match = REVERTED_REVISION_PATTERN.match(line)
70 if reverted_revision_match: 70 if reverted_revision_match:
71 return reverted_revision_match.group(1) 71 return reverted_revision_match.group(1)
OLDNEW
« no previous file with comments | « appengine/findit/libs/gitiles/change_log.py ('k') | appengine/findit/libs/gitiles/diff.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698