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

Side by Side Diff: git_cl.py

Issue 1874253003: git cl checkout: reall fix it. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 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 | no next file » | 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 and Gerrit.""" 8 """A git-command for integrating reviews on Rietveld and Gerrit."""
9 9
10 from distutils.version import LooseVersion 10 from distutils.version import LooseVersion
(...skipping 4526 matching lines...) Expand 10 before | Expand all | Expand 10 after
4537 _, args = parser.parse_args(args) 4537 _, args = parser.parse_args(args)
4538 4538
4539 if len(args) != 1: 4539 if len(args) != 1:
4540 parser.print_help() 4540 parser.print_help()
4541 return 1 4541 return 1
4542 4542
4543 issue_arg = ParseIssueNumberArgument(args[0]) 4543 issue_arg = ParseIssueNumberArgument(args[0])
4544 if not issue_arg.valid: 4544 if not issue_arg.valid:
4545 parser.print_help() 4545 parser.print_help()
4546 return 1 4546 return 1
4547 target_issue = issue_arg.issue 4547 target_issue = str(issue_arg.issue)
4548 4548
4549 key_and_issues = [x.split() for x in RunGit( 4549 key_and_issues = [x.split() for x in RunGit(
4550 ['config', '--local', '--get-regexp', r'branch\..*\.rietveldissue']) 4550 ['config', '--local', '--get-regexp', r'branch\..*\.rietveldissue'])
4551 .splitlines()] 4551 .splitlines()]
4552 branches = [] 4552 branches = []
4553 for key, issue in key_and_issues: 4553 for key, issue in key_and_issues:
4554 if issue == target_issue: 4554 if issue == target_issue:
4555 branches.append(re.sub(r'branch\.(.*)\.rietveldissue', r'\1', key)) 4555 branches.append(re.sub(r'branch\.(.*)\.rietveldissue', r'\1', key))
4556 4556
4557 if len(branches) == 0: 4557 if len(branches) == 0:
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
4628 if __name__ == '__main__': 4628 if __name__ == '__main__':
4629 # These affect sys.stdout so do it outside of main() to simplify mocks in 4629 # These affect sys.stdout so do it outside of main() to simplify mocks in
4630 # unit testing. 4630 # unit testing.
4631 fix_encoding.fix_encoding() 4631 fix_encoding.fix_encoding()
4632 setup_color.init() 4632 setup_color.init()
4633 try: 4633 try:
4634 sys.exit(main(sys.argv[1:])) 4634 sys.exit(main(sys.argv[1:]))
4635 except KeyboardInterrupt: 4635 except KeyboardInterrupt:
4636 sys.stderr.write('interrupted\n') 4636 sys.stderr.write('interrupted\n')
4637 sys.exit(1) 4637 sys.exit(1)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698