Index: scm.py |
=================================================================== |
--- scm.py (revision 161304) |
+++ scm.py (working copy) |
@@ -402,8 +402,23 @@ |
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 20:53:17
Please align at +4, like the rest of the file.
szager
2012/10/11 21:00:43
Done.
|
+ cwd=cwd).rstrip() |
+ if not git_svn_rev: |
+ return None |
+ output = GIT.Capture(['rev-list', '--ancestry-path', '--reverse', |
M-A Ruel
2012/10/11 20:53:17
Same
szager
2012/10/11 21:00:43
Done.
|
+ "--grep='SVN changes up to revision [0-9]*'", |
M-A Ruel
2012/10/11 20:53:17
You could specify
'--grep', 'SVN changes up to rev
szager
2012/10/11 21:00:43
Done.
|
+ '%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) |
M-A Ruel
2012/10/11 20:53:17
That's a funky way to pass out of band information
|
+ return sha1 |
except subprocess2.CalledProcessError: |
return None |