Commit 05fb911f authored by bratell@opera.com's avatar bratell@opera.com

Revert of Allow git cl also in repos with read-only git-svn....

Revert of Allow git cl also in repos with read-only git-svn. (https://codereview.chromium.org/344013005/)

Reason for revert:
Breaks WebRTC (and possibly other projects actually using https:// for svn access).

Original issue's description:
> Allow git cl also in repos with read-only git-svn.
> 
> If you have read-only git-svn git cl would still try
> to use svn commands, which would then fail. This
> changes git cl to only use git-svn if the remote
> svn repository use the svn:// protocol. It matches
> how chromium works and it allowed me to upload a patch.
> 
> BUG=391430
> 
> R=iannucci
> 
> Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=281500

TBR=iannucci@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=391430

Review URL: https://codereview.chromium.org/375553002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@281513 0039d316-1c4b-4281-b951-d872f2087c98
parent 8e05af10
......@@ -327,13 +327,9 @@ class Settings(object):
def GetIsGitSvn(self):
"""Return true if this repo looks like it's using git-svn."""
if self.is_git_svn is None:
# The presence of a svn-remote using the svn:// (or file://)
# protocol suggests that you're using svn. Remotes with the
# http* protocols suggest read-only svn access and are ignored.
code, result = RunGitWithCode(
['config', '--local', '--get-regexp', r'^svn-remote\..*\.url'])
self.is_git_svn = (code == 0 and ("svn://" in result or
"file://" in result))
# If you have any "svn-remote.*" config keys, we think you're using svn.
self.is_git_svn = RunGitWithCode(
['config', '--local', '--get-regexp', r'^svn-remote\.'])[0] == 0
return self.is_git_svn
def GetSVNBranch(self):
......
......@@ -207,8 +207,8 @@ class TestGitCl(TestCase):
] + cc_call + private_call + [
((['git', 'config', 'branch.master.base-url'],), ''),
((['git',
'config', '--local', '--get-regexp', '^svn-remote\\..*\\.url'],),
(('svn-remote.mybranch.url svn://svn.chromium.org/chrome', None), 0)),
'config', '--local', '--get-regexp', '^svn-remote\\.'],),
(('', None), 0)),
((['git', 'rev-parse', '--show-cdup'],), ''),
((['git', 'svn', 'info'],), ''),
((['git', 'config', 'rietveld.project'],), ''),
......@@ -253,7 +253,7 @@ class TestGitCl(TestCase):
def _dcommit_calls_1(cls):
return [
((['git',
'config', '--local', '--get-regexp', '^svn-remote\\..*\\.url'],),
'config', '--local', '--get-regexp', '^svn-remote\\.'],),
((('svn-remote.svn.url svn://svn.chromium.org/chrome\n'
'svn-remote.svn.fetch trunk/src:refs/remotes/origin/master'),
None),
......@@ -775,8 +775,7 @@ class TestGitCl(TestCase):
''),
((['git', 'config', 'rietveld.private',],),
''),
((['git', 'config', '--local', '--get-regexp',
'^svn-remote\\..*\\.url',],),
((['git', 'config', '--local', '--get-regexp', '^svn-remote\\.'],),
''),
((['git', 'config', 'rietveld.project',],),
''),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment