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

Unified Diff: scm.py

Issue 11148019: Restore previous behavior of GetSha1ForSvnRev, so unit tests pass. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 8 years, 2 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 | « gclient_scm.py ('k') | tests/gclient_scm_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scm.py
===================================================================
--- scm.py (revision 161875)
+++ scm.py (working copy)
@@ -402,10 +402,23 @@
if not GIT.IsGitSvn(cwd=cwd):
return None
try:
- git_svn_rev = GIT.Capture(
- ['svn', 'find-rev', 'r' + str(rev)], cwd=cwd).rstrip()
- if not git_svn_rev:
- return None
+ output = GIT.Capture(['svn', 'find-rev', 'r' + str(rev)], cwd=cwd)
+ return GIT.ParseGitSvnSha1(output)
+ except subprocess2.CalledProcessError:
+ return None
+
+ @staticmethod
+ def GetBlessedSha1ForSvnRev(cwd, rev):
+ """Returns a git commit hash from the master branch history that has
+ accurate .DEPS.git and git submodules. To understand why this is more
+ complicated than a simple call to `git svn find-rev`, refer to:
+
+ http://www.chromium.org/developers/how-tos/git-repo
+ """
+ git_svn_rev = GIT.GetSha1ForSvnRev(cwd, rev)
+ if not git_svn_rev:
+ return None
+ try:
output = GIT.Capture(
['rev-list', '--ancestry-path', '--reverse',
'--grep', 'SVN changes up to revision [0-9]*',
« no previous file with comments | « gclient_scm.py ('k') | tests/gclient_scm_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698