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

Side by Side Diff: git_cl.py

Issue 17763004: Fixes depot_tools presubmit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Back to patchset 2 Created 7 years, 5 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 | Annotate | Revision Log
« 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.""" 8 """A git-command for integrating reviews on Rietveld."""
9 9
10 import difflib 10 import difflib
(...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 show_branches = not options.field 1047 show_branches = not options.field
1048 1048
1049 if show_branches: 1049 if show_branches:
1050 branches = RunGit(['for-each-ref', '--format=%(refname)', 'refs/heads']) 1050 branches = RunGit(['for-each-ref', '--format=%(refname)', 'refs/heads'])
1051 if branches: 1051 if branches:
1052 changes = (Changelist(branchref=b) for b in branches.splitlines()) 1052 changes = (Changelist(branchref=b) for b in branches.splitlines())
1053 branches = dict((cl.GetBranch(), cl.GetIssueURL()) for cl in changes) 1053 branches = dict((cl.GetBranch(), cl.GetIssueURL()) for cl in changes)
1054 alignment = max(5, max(len(b) for b in branches)) 1054 alignment = max(5, max(len(b) for b in branches))
1055 print 'Branches associated with reviews:' 1055 print 'Branches associated with reviews:'
1056 for branch in sorted(branches): 1056 for branch in sorted(branches):
1057 print " %*s: %s" % (alignment, branch, branches[branch] or '') 1057 print " %*s: %s" % (alignment, branch, branches[branch])
1058 1058
1059 cl = Changelist() 1059 cl = Changelist()
1060 if options.field: 1060 if options.field:
1061 if options.field.startswith('desc'): 1061 if options.field.startswith('desc'):
1062 print cl.GetDescription() 1062 print cl.GetDescription()
1063 elif options.field == 'id': 1063 elif options.field == 'id':
1064 issueid = cl.GetIssue() 1064 issueid = cl.GetIssue()
1065 if issueid: 1065 if issueid:
1066 print issueid 1066 print issueid
1067 elif options.field == 'patch': 1067 elif options.field == 'patch':
(...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after
2142 GenUsage(parser, 'help') 2142 GenUsage(parser, 'help')
2143 return CMDhelp(parser, argv) 2143 return CMDhelp(parser, argv)
2144 2144
2145 2145
2146 if __name__ == '__main__': 2146 if __name__ == '__main__':
2147 # These affect sys.stdout so do it outside of main() to simplify mocks in 2147 # These affect sys.stdout so do it outside of main() to simplify mocks in
2148 # unit testing. 2148 # unit testing.
2149 fix_encoding.fix_encoding() 2149 fix_encoding.fix_encoding()
2150 colorama.init() 2150 colorama.init()
2151 sys.exit(main(sys.argv[1:])) 2151 sys.exit(main(sys.argv[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