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

Unified Diff: build/util/lastchange.py

Issue 6265021: lastchange: add a flag to only print the svn revision number (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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 | « no previous file | chrome/chrome_installer.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/util/lastchange.py
diff --git a/build/util/lastchange.py b/build/util/lastchange.py
index ff518fc305c7e3ef934b05a6481804e172fe0f76..1846babac8d76c87976b562726a337c98da399f9 100755
--- a/build/util/lastchange.py
+++ b/build/util/lastchange.py
@@ -71,11 +71,13 @@ def main(argv=None):
if argv is None:
argv = sys.argv
- parser = optparse.OptionParser(usage="lastchange.py [-h] [[-o] FILE]")
+ parser = optparse.OptionParser(usage="lastchange.py [options]")
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")
+ parser.add_option("--revision-only", action='store_true',
+ help="just print the SVN revision number")
opts, args = parser.parse_args(argv[1:])
out_file = opts.output
@@ -90,12 +92,14 @@ def main(argv=None):
change = FetchChange(opts.default_lastchange)
- contents = "LASTCHANGE=%s\n" % change
-
- if out_file:
- WriteIfChanged(out_file, contents)
+ if opts.revision_only:
+ print change
else:
- sys.stdout.write(contents)
+ contents = "LASTCHANGE=%s\n" % change
+ if out_file:
+ WriteIfChanged(out_file, contents)
+ else:
+ sys.stdout.write(contents)
return 0
« no previous file with comments | « no previous file | chrome/chrome_installer.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698