Chromium Code Reviews| Index: scm.py |
| =================================================================== |
| --- scm.py (revision 161386) |
| +++ scm.py (working copy) |
| @@ -402,8 +402,22 @@ |
| if not GIT.IsGitSvn(cwd=cwd): |
| return None |
| try: |
| - output = GIT.Capture(['svn', 'find-rev', 'r' + str(rev)], cwd=cwd) |
| - return GIT.ParseGitSvnSha1(output) |
| + git_svn_rev = GIT.Capture(['svn', 'find-rev', 'r' + str(rev)], |
|
M-A Ruel
2012/10/11 21:06:14
git_svn_rev = GIT.Capture(
['svn', 'find-rev',
|
| + cwd=cwd).rstrip() |
| + if not git_svn_rev: |
| + return None |
| + output = GIT.Capture(['rev-list', '--ancestry-path', '--reverse', |
|
M-A Ruel
2012/10/11 21:06:14
same
|
| + '--grep', 'SVN changes up to revision [0-9]*', |
| + '%s..refs/remotes/origin/master' % git_svn_rev], cwd=cwd) |
| + if not output: |
| + return None |
| + sha1 = output.splitlines()[0] |
| + if not sha1: |
| + return None |
| + output = GIT.Capture(['rev-list', '-n', '1', '%s^1' % sha1], cwd=cwd) |
| + if git_svn_rev != output.rstrip(): |
| + raise gclient_utils.Error(sha1) |
| + return sha1 |
| except subprocess2.CalledProcessError: |
| return None |