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

Side by Side Diff: tools/gn/last_commit_position.py

Issue 2237913002: GN: fail gracefully when git commit info cannot be extracted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« 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 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Writes the most recent "Cr-Commit-Position" value on the master branch 5 """Writes the most recent "Cr-Commit-Position" value on the master branch
6 to a C header file. 6 to a C header file.
7 7
8 Usage: last_commit_position.py <dir> <outfile> <headerguard> 8 Usage: last_commit_position.py <dir> <outfile> <headerguard>
9 9
10 <dir> 10 <dir>
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 if len(sys.argv) != 4: 88 if len(sys.argv) != 4:
89 print "Wrong number of arguments" 89 print "Wrong number of arguments"
90 sys.exit(1) 90 sys.exit(1)
91 91
92 git_directory = sys.argv[1] 92 git_directory = sys.argv[1]
93 output_file = sys.argv[2] 93 output_file = sys.argv[2]
94 header_guard = sys.argv[3] 94 header_guard = sys.argv[3]
95 95
96 value = FetchCommitPosition(git_directory) 96 value = FetchCommitPosition(git_directory)
97 if not value: 97 if not value:
98 print "Could not get last commit position." 98 value = 'UNKNOWN'
99 sys.exit(1)
100 99
101 WriteHeader(output_file, header_guard, value) 100 WriteHeader(output_file, header_guard, value)
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