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

Side by Side Diff: gcl.py

Issue 6679026: Revert 77909 - msysgit - Fix issue where gcl doesn't recognize the editor.... (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 | 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/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 if not silent:
1067 try: 1067 os.system(GetEditor() + " " + filename)
1068 if not silent: 1068
1069 subprocess.check_call(['env', GetEditor(), filename], shell=True) 1069 result = gclient_utils.FileRead(filename, 'r')
1070 result = gclient_utils.FileRead(filename, 'r') 1070 os.remove(filename)
1071 finally:
1072 os.remove(filename)
1073 1071
1074 if not result: 1072 if not result:
1075 return 0 1073 return 0
1076 1074
1077 split_result = result.split(separator1, 1) 1075 split_result = result.split(separator1, 1)
1078 if len(split_result) != 2: 1076 if len(split_result) != 2:
1079 ErrorExit("Don't modify the text starting with ---!\n\n" + result) 1077 ErrorExit("Don't modify the text starting with ---!\n\n" + result)
1080 1078
1081 # Update the CL description if it has changed. 1079 # Update the CL description if it has changed.
1082 new_description = split_result[0] 1080 new_description = split_result[0]
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1395 if e.code != 500: 1393 if e.code != 500:
1396 raise 1394 raise
1397 print >> sys.stderr, ( 1395 print >> sys.stderr, (
1398 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' 1396 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith '
1399 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) 1397 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))
1400 return 1 1398 return 1
1401 1399
1402 1400
1403 if __name__ == "__main__": 1401 if __name__ == "__main__":
1404 sys.exit(main(sys.argv[1:])) 1402 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