Revert 250482 "Re-reland r245404 ("If the destination directory ..."
> Re-reland r245404 ("If the destination directory doesn't contain the desired repo, delete it")
>
> BUG=
>
> Review URL: https://codereview.chromium.org/133073015
TBR=borenet@google.com
Review URL: https://codereview.chromium.org/146583013
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@250878 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/scm.py b/scm.py
index 60ba800..30bb3d1 100644
--- a/scm.py
+++ b/scm.py
@@ -166,15 +166,12 @@
return GIT.ShortBranchName(GIT.GetBranchRef(cwd))
@staticmethod
- def IsGitSvn(checkout_root):
+ def IsGitSvn(cwd):
"""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
# 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=checkout_root)
+ cwd=cwd)
return True
except subprocess2.CalledProcessError:
return False
@@ -411,7 +408,7 @@
@staticmethod
def GetSha1ForSvnRev(cwd, rev):
"""Returns a corresponding git sha1 for a SVN revision."""
- if not GIT.IsGitSvn(cwd):
+ if not GIT.IsGitSvn(cwd=cwd):
return None
try:
output = GIT.Capture(['svn', 'find-rev', 'r' + str(rev)], cwd=cwd)