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

Side by Side Diff: gcl.py

Issue 6684022: Revert 77913 - Regression: Editor Linux Fix for gcl.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 9 years, 9 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 | git_cl/git_cl.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/python 1 #!/usr/bin/python
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2010 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 """\ 6 """\
7 Wrapper script around Rietveld's upload.py that simplifies working with groups 7 Wrapper script around Rietveld's upload.py that simplifies working with groups
8 of files. 8 of files.
9 """ 9 """
10 10
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 '\n'.join([f[0] + f[1] for f in affected_files]) + '\n') 1056 '\n'.join([f[0] + f[1] for f in affected_files]) + '\n')
1057 else: 1057 else:
1058 text += ('\n'.join([f[0] + f[1] for f in affected_files]) + '\n' + 1058 text += ('\n'.join([f[0] + f[1] for f in affected_files]) + '\n' +
1059 separator2) 1059 separator2)
1060 text += '\n'.join([f[0] + f[1] for f in unaffected_files]) + '\n' 1060 text += '\n'.join([f[0] + f[1] for f in unaffected_files]) + '\n'
1061 1061
1062 handle, filename = tempfile.mkstemp(text=True) 1062 handle, filename = tempfile.mkstemp(text=True)
1063 os.write(handle, text) 1063 os.write(handle, text)
1064 os.close(handle) 1064 os.close(handle)
1065 1065
1066 result = None
1066 try: 1067 try:
1067 if not silent: 1068 if not silent:
1068 subprocess.check_call(['env', GetEditor(), filename]) 1069 subprocess.check_call(['env', GetEditor(), filename], shell=True)
1069 result = gclient_utils.FileRead(filename, 'r') 1070 result = gclient_utils.FileRead(filename, 'r')
1070 finally: 1071 finally:
1071 os.remove(filename) 1072 os.remove(filename)
1072 1073
1073 if not result: 1074 if not result:
1074 return 0 1075 return 0
1075 1076
1076 split_result = result.split(separator1, 1) 1077 split_result = result.split(separator1, 1)
1077 if len(split_result) != 2: 1078 if len(split_result) != 2:
1078 ErrorExit("Don't modify the text starting with ---!\n\n" + result) 1079 ErrorExit("Don't modify the text starting with ---!\n\n" + result)
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
1394 if e.code != 500: 1395 if e.code != 500:
1395 raise 1396 raise
1396 print >> sys.stderr, ( 1397 print >> sys.stderr, (
1397 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' 1398 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith '
1398 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) 1399 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))
1399 return 1 1400 return 1
1400 1401
1401 1402
1402 if __name__ == "__main__": 1403 if __name__ == "__main__":
1403 sys.exit(main(sys.argv[1:])) 1404 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | git_cl/git_cl.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698