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

Side by Side Diff: appengine/third_party_local/depot_tools/git_number.py

Issue 2013943002: Changing license header, again! (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2013 The Chromium Authors. All rights reserved. 2 # Copyright 2013 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 # that can be found in the LICENSE file.
5 5
6 """Usage: %prog [options] [<commitref>]* 6 """Usage: %prog [options] [<commitref>]*
7 7
8 If no <commitref>'s are supplied, it defaults to HEAD. 8 If no <commitref>'s are supplied, it defaults to HEAD.
9 9
10 Calculates the generation number for one or more commits in a git repo. 10 Calculates the generation number for one or more commits in a git repo.
11 11
12 Generation number of a commit C with parents P is defined as: 12 Generation number of a commit C with parents P is defined as:
13 generation_number(C, []) = 0 13 generation_number(C, []) = 0
14 generation_number(C, P) = max(map(generation_number, P)) + 1 14 generation_number(C, P) = max(map(generation_number, P)) + 1
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 print '\n'.join(map(str, map(get_num, targets))) 275 print '\n'.join(map(str, map(get_num, targets)))
276 return 0 276 return 0
277 277
278 278
279 if __name__ == '__main__': # pragma: no cover 279 if __name__ == '__main__': # pragma: no cover
280 try: 280 try:
281 sys.exit(main()) 281 sys.exit(main())
282 except KeyboardInterrupt: 282 except KeyboardInterrupt:
283 sys.stderr.write('interrupted\n') 283 sys.stderr.write('interrupted\n')
284 sys.exit(1) 284 sys.exit(1)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698