From 99f75c9bca7a28cdb913e740922b71d5722bf503 Mon Sep 17 00:00:00 2001 From: CG Linden Date: Fri, 6 Nov 2009 15:52:51 -0800 Subject: Add support for externally specified revision number (codeticket) --- scripts/update_version_files.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/update_version_files.py b/scripts/update_version_files.py index ee1ce69a15..204986c73a 100755 --- a/scripts/update_version_files.py +++ b/scripts/update_version_files.py @@ -47,6 +47,9 @@ def usage(): Options: --version Specify the version string to replace current version. + --revision + Specify the revision to replace the last digit of the version. + By default, revision is computed from the version control system. --skip-on-branch Specify a regular expression against which the current branch is matched. If it matches, then leave version strings alone. @@ -171,12 +174,15 @@ def main(): update_server = False update_viewer = False new_version = None + new_revision = None new_viewer_channel = None new_server_channel = None skip_on_branch_re = None for o,a in opts: if o in ('--version'): new_version = a + if o in ('--revision'): + new_revision = a if o in ('--skip-on-branch'): skip_on_branch_re = re.compile(a) if o in ('--channel'): @@ -243,11 +249,20 @@ def main(): else: if llversion.using_svn(): - revision = llversion.get_svn_revision() + if new_revision: + revision = new_revision + else: + revision = llversion.get_svn_revision() branch = llversion.get_svn_branch() elif llversion.using_hg(): - revision = llversion.get_hg_changeset() + if new_revision: + revision = new_revision + else: + revision = llversion.get_hg_changeset() branch = llversion.get_hg_repo() + elif new_revision: + revision = new_revision + branch = "unknown" else: print >>sys.stderr, "ERROR: could not determine revision and branch" return -1 -- cgit v1.2.3 From 66cf090114379244ae8c67dc37b8c8d75b806cae Mon Sep 17 00:00:00 2001 From: CG Linden Date: Fri, 6 Nov 2009 15:54:11 -0800 Subject: Adding new option definition - forgot. --- scripts/update_version_files.py | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/update_version_files.py b/scripts/update_version_files.py index 204986c73a..da60fd105a 100755 --- a/scripts/update_version_files.py +++ b/scripts/update_version_files.py @@ -164,6 +164,7 @@ def main(): opts, args = getopt.getopt(sys.argv[1:], "", ['version=', + 'revision=', 'channel=', 'server_channel=', 'skip-on-branch=', -- cgit v1.2.3