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

Unified Diff: build/util/lastchange.py

Issue 159876: Allow the lastchange target to get a hard-coded default last change... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/util/build_util.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/util/lastchange.py
===================================================================
--- build/util/lastchange.py (revision 22422)
+++ build/util/lastchange.py (working copy)
@@ -60,7 +60,7 @@
return id
-def fetch_change():
+def fetch_change(default_lastchange):
"""
Returns the last change, from some appropriate revision control system.
"""
@@ -68,7 +68,10 @@
if not change and sys.platform in ('linux2',):
change = git_fetch_id()
if not change:
- change = '0'
+ if default_lastchange and os.path.exists(default_lastchange):
+ change = open(default_lastchange, 'r').read().strip()
+ else:
+ change = '0'
return change
@@ -93,6 +96,8 @@
argv = sys.argv
parser = optparse.OptionParser(usage="lastchange.py [-h] [[-o] FILE]")
+ parser.add_option("-d", "--default-lastchange", metavar="FILE",
+ help="default last change input FILE")
parser.add_option("-o", "--output", metavar="FILE",
help="write last change to FILE")
opts, args = parser.parse_args(argv[1:])
@@ -107,7 +112,7 @@
parser.print_help()
sys.exit(2)
- change = fetch_change()
+ change = fetch_change(opts.default_lastchange)
contents = "LASTCHANGE=%s\n" % change
« no previous file with comments | « build/util/build_util.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698