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

Side by Side Diff: gcl.py

Issue 6680019: Reland - Support msysgit in gcl and git-cl... (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') | git_cl/git_cl.py » ('J')
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 if not silent: 1066 # Open up the default editor in the system to get the CL description.
1067 os.system(GetEditor() + " " + filename) 1067 cmd = [GetEditor(), filename]
1068 1068 if sys.platform == 'win32' and 'mingw\\bin' in os.environ['PATH']:
1069 result = gclient_utils.FileRead(filename, 'r') 1069 # Msysgit requires the usage of 'env' to be present. The only way to
1070 os.remove(filename) 1070 # accomplish that is by reading the environment variable for mingw\bin.
1071 cmd.insert(0, 'env')
1072 try:
1073 if not silent:
1074 subprocess.check_call(cmd)
1075 result = gclient_utils.FileRead(filename, 'r')
1076 finally:
1077 os.remove(filename)
1071 1078
1072 if not result: 1079 if not result:
1073 return 0 1080 return 0
1074 1081
1075 split_result = result.split(separator1, 1) 1082 split_result = result.split(separator1, 1)
1076 if len(split_result) != 2: 1083 if len(split_result) != 2:
1077 ErrorExit("Don't modify the text starting with ---!\n\n" + result) 1084 ErrorExit("Don't modify the text starting with ---!\n\n" + result)
1078 1085
1079 # Update the CL description if it has changed. 1086 # Update the CL description if it has changed.
1080 new_description = split_result[0] 1087 new_description = split_result[0]
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1393 if e.code != 500: 1400 if e.code != 500:
1394 raise 1401 raise
1395 print >> sys.stderr, ( 1402 print >> sys.stderr, (
1396 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' 1403 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith '
1397 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) 1404 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))
1398 return 1 1405 return 1
1399 1406
1400 1407
1401 if __name__ == "__main__": 1408 if __name__ == "__main__":
1402 sys.exit(main(sys.argv[1:])) 1409 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | git_cl/git_cl.py » ('j') | git_cl/git_cl.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698