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

Side by Side Diff: git_cl.py

Issue 19027002: Fix pylint presubmit failure (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 env=env, 83 env=env,
84 stdout=subprocess2.PIPE) 84 stdout=subprocess2.PIPE)
85 return code, out[0] 85 return code, out[0]
86 except ValueError: 86 except ValueError:
87 # When the subprocess fails, it returns None. That triggers a ValueError 87 # When the subprocess fails, it returns None. That triggers a ValueError
88 # when trying to unpack the return value into (out, code). 88 # when trying to unpack the return value into (out, code).
89 return 1, '' 89 return 1, ''
90 90
91 91
92 def IsGitVersionAtLeast(min_version): 92 def IsGitVersionAtLeast(min_version):
93 PREFIX='git version ' 93 prefix = 'git version '
94 version = RunGit(['--version']).strip() 94 version = RunGit(['--version']).strip()
95 return (version.startswith(PREFIX) and 95 return (version.startswith(prefix) and
96 LooseVersion(version[len(PREFIX):]) >= LooseVersion(min_version)) 96 LooseVersion(version[len(prefix):]) >= LooseVersion(min_version))
97 97
98 98
99 def usage(more): 99 def usage(more):
100 def hook(fn): 100 def hook(fn):
101 fn.usage_more = more 101 fn.usage_more = more
102 return fn 102 return fn
103 return hook 103 return hook
104 104
105 105
106 def ask_for_data(prompt): 106 def ask_for_data(prompt):
(...skipping 2070 matching lines...) Expand 10 before | Expand all | Expand 10 after
2177 GenUsage(parser, 'help') 2177 GenUsage(parser, 'help')
2178 return CMDhelp(parser, argv) 2178 return CMDhelp(parser, argv)
2179 2179
2180 2180
2181 if __name__ == '__main__': 2181 if __name__ == '__main__':
2182 # These affect sys.stdout so do it outside of main() to simplify mocks in 2182 # These affect sys.stdout so do it outside of main() to simplify mocks in
2183 # unit testing. 2183 # unit testing.
2184 fix_encoding.fix_encoding() 2184 fix_encoding.fix_encoding()
2185 colorama.init() 2185 colorama.init()
2186 sys.exit(main(sys.argv[1:])) 2186 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