Chromium Code Reviews| Index: scm.py |
| diff --git a/scm.py b/scm.py |
| index 30bb3d17ea49bd74c0a83af490bbc486d60e3f41..e0f17004c9945289b138fc649cd300df0bab2090 100644 |
| --- a/scm.py |
| +++ b/scm.py |
| @@ -166,12 +166,15 @@ class GIT(object): |
| return GIT.ShortBranchName(GIT.GetBranchRef(cwd)) |
| @staticmethod |
| - def IsGitSvn(cwd): |
| + def IsGitSvn(checkout_root): |
| """Returns true if this repo looks like it's using git-svn.""" |
| + # A git-svn checkout has a .git directory. |
| + if not os.path.isdir(os.path.join(checkout_root, '.git')): |
| + return False |
|
borenet
2014/02/06 16:21:47
From what I can tell, the last version was failing
iannucci
2014/02/06 23:05:11
Yeah that makes sense... gclient supports too many
|
| # If you have any "svn-remote.*" config keys, we think you're using svn. |
| try: |
| GIT.Capture(['config', '--local', '--get-regexp', r'^svn-remote\.'], |
| - cwd=cwd) |
| + cwd=checkout_root) |
| return True |
| except subprocess2.CalledProcessError: |
| return False |
| @@ -313,7 +316,7 @@ class GIT(object): |
| pass |
| else: |
| # Fall back on trying a git-svn upstream branch. |
| - if GIT.IsGitSvn(cwd): |
| + if GIT.IsGitSvn(checkout_root=cwd): |
| upstream_branch = GIT.GetSVNBranch(cwd) |
| else: |
| # Else, try to guess the origin remote. |
| @@ -408,7 +411,7 @@ class GIT(object): |
| @staticmethod |
| def GetSha1ForSvnRev(cwd, rev): |
| """Returns a corresponding git sha1 for a SVN revision.""" |
| - if not GIT.IsGitSvn(cwd=cwd): |
| + if not GIT.IsGitSvn(checkout_root=cwd): |
| return None |
| try: |
| output = GIT.Capture(['svn', 'find-rev', 'r' + str(rev)], cwd=cwd) |