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

Side by Side Diff: git_cl.py

Issue 7858008: git cl assumes no shell is used. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 3 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) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 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 logging 10 import logging
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 DESCRIPTION_BACKUP_FILE = '~/.git_cl_description_backup' 48 DESCRIPTION_BACKUP_FILE = '~/.git_cl_description_backup'
49 49
50 50
51 def DieWithError(message): 51 def DieWithError(message):
52 print >> sys.stderr, message 52 print >> sys.stderr, message
53 sys.exit(1) 53 sys.exit(1)
54 54
55 55
56 def RunCommand(args, error_ok=False, error_message=None, **kwargs): 56 def RunCommand(args, error_ok=False, error_message=None, **kwargs):
57 try: 57 try:
58 return subprocess2.check_output(args, **kwargs) 58 return subprocess2.check_output(args, shell=False, **kwargs)
59 except subprocess2.CalledProcessError, e: 59 except subprocess2.CalledProcessError, e:
60 if not error_ok: 60 if not error_ok:
61 DieWithError( 61 DieWithError(
62 'Command "%s" failed.\n%s' % ( 62 'Command "%s" failed.\n%s' % (
63 ' '.join(args), error_message or e.stdout or '')) 63 ' '.join(args), error_message or e.stdout or ''))
64 return e.stdout 64 return e.stdout
65 65
66 66
67 def RunGit(args, **kwargs): 67 def RunGit(args, **kwargs):
68 """Returns stdout.""" 68 """Returns stdout."""
(...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after
1430 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) 1430 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)))
1431 1431
1432 # Not a known command. Default to help. 1432 # Not a known command. Default to help.
1433 GenUsage(parser, 'help') 1433 GenUsage(parser, 'help')
1434 return CMDhelp(parser, argv) 1434 return CMDhelp(parser, argv)
1435 1435
1436 1436
1437 if __name__ == '__main__': 1437 if __name__ == '__main__':
1438 fix_encoding.fix_encoding() 1438 fix_encoding.fix_encoding()
1439 sys.exit(main(sys.argv[1:])) 1439 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