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

Unified Diff: git_footers.py

Issue 1135563005: Improve "dcommit in git repo" error message. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: presubmit fix Created 5 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 | « git_cl.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_footers.py
diff --git a/git_footers.py b/git_footers.py
index 01a4cd5805180a4bd025aa9baf62c64ba5c5a8e8..3e3ea827ba5cb771802478bcb7121d203cd4f284 100755
--- a/git_footers.py
+++ b/git_footers.py
@@ -48,6 +48,20 @@ def parse_footers(message):
return footer_map
+def get_footer_svn_id(branch=None):
+ if not branch:
+ branch = git.root()
+ svn_id = None
+ message = git.run('log', '-1', '--format=%B', branch)
+ footers = parse_footers(message)
+ git_svn_id = get_unique(footers, 'git-svn-id')
+ if git_svn_id:
+ match = GIT_SVN_ID_PATTERN.match(git_svn_id)
+ if match:
+ svn_id = match.group(1)
+ return svn_id
+
+
def get_unique(footers, key):
key = normalize_name(key)
values = footers[key]
« no previous file with comments | « git_cl.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698