Commit 9e63fded authored by evan@chromium.org's avatar evan@chromium.org

lastchange: add a flag to only print the svn revision number

This allows me to change one of the callers to not parse the
"REVISION=1234" output, which will allow me to change that output
in a future change.

BUG=41264

Review URL: http://codereview.chromium.org/6265021

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72170 0039d316-1c4b-4281-b951-d872f2087c98
parent 75adb07d
......@@ -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
......
......@@ -340,7 +340,7 @@
# Always google_chrome since this only applies to branding==Chrome.
'branding_dir': 'app/theme/google_chrome',
'version' : '<!(python <(version_py_path) -f <(DEPTH)/chrome/VERSION -t "@MAJOR@.@MINOR@.@BUILD@.@PATCH@")',
'revision' : '<!(python <(DEPTH)/build/util/lastchange.py | cut -d "=" -f 2)',
'revision' : '<!(python <(DEPTH)/build/util/lastchange.py --revision-only)',
'packaging_files_common': [
'installer/linux/internal/common/apt.include',
'installer/linux/internal/common/default-app.template',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment