Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: git_cl.py

Issue 13884014: Ensures that local git config is used while checking if it is a Git-svn repo. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tests/git_cl_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 # Copyright (C) 2008 Evan Martin <martine@danga.com> 6 # Copyright (C) 2008 Evan Martin <martine@danga.com>
7 7
8 """A git-command for integrating reviews on Rietveld.""" 8 """A git-command for integrating reviews on Rietveld."""
9 9
10 import json 10 import json
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 def GetRoot(self): 271 def GetRoot(self):
272 if not self.root: 272 if not self.root:
273 self.root = os.path.abspath(RunGit(['rev-parse', '--show-cdup']).strip()) 273 self.root = os.path.abspath(RunGit(['rev-parse', '--show-cdup']).strip())
274 return self.root 274 return self.root
275 275
276 def GetIsGitSvn(self): 276 def GetIsGitSvn(self):
277 """Return true if this repo looks like it's using git-svn.""" 277 """Return true if this repo looks like it's using git-svn."""
278 if self.is_git_svn is None: 278 if self.is_git_svn is None:
279 # If you have any "svn-remote.*" config keys, we think you're using svn. 279 # If you have any "svn-remote.*" config keys, we think you're using svn.
280 self.is_git_svn = RunGitWithCode( 280 self.is_git_svn = RunGitWithCode(
281 ['config', '--get-regexp', r'^svn-remote\.'])[0] == 0 281 ['config', '--local', '--get-regexp', r'^svn-remote\.'])[0] == 0
282 return self.is_git_svn 282 return self.is_git_svn
283 283
284 def GetSVNBranch(self): 284 def GetSVNBranch(self):
285 if self.svn_branch is None: 285 if self.svn_branch is None:
286 if not self.GetIsGitSvn(): 286 if not self.GetIsGitSvn():
287 DieWithError('Repo doesn\'t appear to be a git-svn repo.') 287 DieWithError('Repo doesn\'t appear to be a git-svn repo.')
288 288
289 # Try to figure out which remote branch we're based on. 289 # Try to figure out which remote branch we're based on.
290 # Strategy: 290 # Strategy:
291 # 1) iterate through our branch history and find the svn URL. 291 # 1) iterate through our branch history and find the svn URL.
(...skipping 1675 matching lines...) Expand 10 before | Expand all | Expand 10 after
1967 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) 1967 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)))
1968 1968
1969 # Not a known command. Default to help. 1969 # Not a known command. Default to help.
1970 GenUsage(parser, 'help') 1970 GenUsage(parser, 'help')
1971 return CMDhelp(parser, argv) 1971 return CMDhelp(parser, argv)
1972 1972
1973 1973
1974 if __name__ == '__main__': 1974 if __name__ == '__main__':
1975 fix_encoding.fix_encoding() 1975 fix_encoding.fix_encoding()
1976 sys.exit(main(sys.argv[1:])) 1976 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | tests/git_cl_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698