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

Unified Diff: git_auto_svn.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 | « no previous file | git_cl.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_auto_svn.py
diff --git a/git_auto_svn.py b/git_auto_svn.py
index 0e8f341c7ca616c50cd7e3a75a1f0b3af0981640..722029c9d43be9d50b29de3f2c549c300587e136 100755
--- a/git_auto_svn.py
+++ b/git_auto_svn.py
@@ -23,7 +23,7 @@ import subprocess2
from git_common import run as run_git
from git_common import run_stream as run_git_stream
from git_common import set_config, root, ROOT
-from git_footers import parse_footers, get_unique, GIT_SVN_ID_PATTERN
+from git_footers import get_footer_svn_id
SVN_EXE = ROOT+'\\svn.bat' if sys.platform.startswith('win') else 'svn'
@@ -58,14 +58,11 @@ def main(argv):
parser.parse_args(argv)
upstream = root()
- message = run_git('log', '-1', '--format=%B', upstream)
- footers = parse_footers(message)
- git_svn_id = get_unique(footers, 'git-svn-id')
- match = GIT_SVN_ID_PATTERN.match(git_svn_id)
- assert match, 'No valid git-svn-id footer found on %s.' % upstream
- print 'Found git-svn-id footer %s on %s' % (match.group(1), upstream)
-
- parsed_svn = urlparse.urlparse(match.group(1))
+ svn_id = get_footer_svn_id(upstream)
+ assert svn_id, 'No valid git-svn-id footer found on %s.' % upstream
+ print 'Found git-svn-id footer %s on %s' % (svn_id, upstream)
+
+ parsed_svn = urlparse.urlparse(svn_id)
path_components = parsed_svn.path.split('/')
svn_repo = None
svn_path = None
@@ -86,7 +83,7 @@ def main(argv):
' from https://chromium-access.appspot.com' % maybe_repo)
print
continue
- assert svn_repo is not None, 'Unable to find svn repo for %s' % match.group(1)
+ assert svn_repo is not None, 'Unable to find svn repo for %s' % svn_id
print 'Found upstream svn repo %s and path %s' % (svn_repo, svn_path)
set_config('svn-remote.svn.url', svn_repo)
« no previous file with comments | « no previous file | git_cl.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698