From 89de8e5b552b997335a429ad41f86e4200441b11 Mon Sep 17 00:00:00 2001
From: CG Linden <cg@lindenlab.com>
Date: Mon, 31 Aug 2009 13:26:35 -0700
Subject: Port over the new build scripts from para-test, tweek
 update_version_files to use the repo revision number for now.

---
 scripts/update_version_files.py | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

(limited to 'scripts')

diff --git a/scripts/update_version_files.py b/scripts/update_version_files.py
index 9081941521..977b66253a 100755
--- a/scripts/update_version_files.py
+++ b/scripts/update_version_files.py
@@ -37,6 +37,8 @@ add_indra_lib_path()
 import getopt, os, re, commands
 from indra.util import llversion
 
+hg = os.path.expandvars("${HG}")
+if not hg or hg == "${HG}": hg = "hg"
 svn = os.path.expandvars("${SVN}")
 if not svn or svn == "${SVN}": svn = "svn"
 
@@ -152,6 +154,8 @@ re_map['indra/newview/English.lproj/InfoPlist.strings'] = \
 version_re      = re.compile('(\d+).(\d+).(\d+).(\d+)')
 svn_branch_re   = re.compile('^URL:\s+\S+/([^/\s]+)$', re.MULTILINE)
 svn_revision_re = re.compile('^Last Changed Rev: (\d+)$', re.MULTILINE)
+hg_branch_re    = re.compile('^.*_([^_\s]*)\s*$', re.MULTILINE)
+hg_revision_re  = re.compile('^changeset:\s+(\d+):', re.MULTILINE)
 
 def main():
     script_path = os.path.dirname(__file__)
@@ -244,14 +248,24 @@ def main():
         # Assume we're updating just the build number
         cl = '%s info "%s"' % (svn, src_root)
         status, output = _getstatusoutput(cl)
+        branch_match = None
+        revision_match = None
+        if status == 0:
+            branch_match = svn_branch_re.search(output)
+            revision_match = svn_revision_re.search(output)
+        else:
+            cl = '%s log --limit 1' % hg
+            status, output = _getstatusoutput(cl)
+            if status == 0:
+                branch_match = hg_branch_re.search(os.path.expandvars("${PARABUILD_BUILD_NAME}"))
+                revision_match = hg_revision_re.search(output)
+
         if verbose:
             print
             print "svn info output:"
             print "----------------"
             print output
 
-        branch_match = svn_branch_re.search(output)
-        revision_match = svn_revision_re.search(output)
         if not branch_match or not revision_match:
             print "Failed to execute svn info, output follows:"
             print output
-- 
cgit v1.2.3


From 5f3a7fa6f3ba45d875ec437c5df9e712f3c6b5a2 Mon Sep 17 00:00:00 2001
From: Bryan O'Sullivan <bos@lindenlab.com>
Date: Tue, 1 Sep 2009 11:18:33 -0700
Subject: Patch in some other useful scripts from trunk.

---
 scripts/update_version_files.py | 38 +++++++++-----------------------------
 1 file changed, 9 insertions(+), 29 deletions(-)

(limited to 'scripts')

diff --git a/scripts/update_version_files.py b/scripts/update_version_files.py
index 977b66253a..ee1ce69a15 100755
--- a/scripts/update_version_files.py
+++ b/scripts/update_version_files.py
@@ -37,8 +37,6 @@ add_indra_lib_path()
 import getopt, os, re, commands
 from indra.util import llversion
 
-hg = os.path.expandvars("${HG}")
-if not hg or hg == "${HG}": hg = "hg"
 svn = os.path.expandvars("${SVN}")
 if not svn or svn == "${SVN}": svn = "svn"
 
@@ -154,8 +152,6 @@ re_map['indra/newview/English.lproj/InfoPlist.strings'] = \
 version_re      = re.compile('(\d+).(\d+).(\d+).(\d+)')
 svn_branch_re   = re.compile('^URL:\s+\S+/([^/\s]+)$', re.MULTILINE)
 svn_revision_re = re.compile('^Last Changed Rev: (\d+)$', re.MULTILINE)
-hg_branch_re    = re.compile('^.*_([^_\s]*)\s*$', re.MULTILINE)
-hg_revision_re  = re.compile('^changeset:\s+(\d+):', re.MULTILINE)
 
 def main():
     script_path = os.path.dirname(__file__)
@@ -245,33 +241,17 @@ def main():
         if update_server:
             server_version = new_version
     else:
-        # Assume we're updating just the build number
-        cl = '%s info "%s"' % (svn, src_root)
-        status, output = _getstatusoutput(cl)
-        branch_match = None
-        revision_match = None
-        if status == 0:
-            branch_match = svn_branch_re.search(output)
-            revision_match = svn_revision_re.search(output)
+
+        if llversion.using_svn():
+            revision = llversion.get_svn_revision()
+            branch = llversion.get_svn_branch()
+        elif llversion.using_hg():
+            revision = llversion.get_hg_changeset()
+            branch = llversion.get_hg_repo()
         else:
-            cl = '%s log --limit 1' % hg
-            status, output = _getstatusoutput(cl)
-            if status == 0:
-                branch_match = hg_branch_re.search(os.path.expandvars("${PARABUILD_BUILD_NAME}"))
-                revision_match = hg_revision_re.search(output)
-
-        if verbose:
-            print
-            print "svn info output:"
-            print "----------------"
-            print output
-
-        if not branch_match or not revision_match:
-            print "Failed to execute svn info, output follows:"
-            print output
+            print >>sys.stderr, "ERROR: could not determine revision and branch"
             return -1
-        branch = branch_match.group(1)
-        revision = revision_match.group(1)
+        
         if skip_on_branch_re and skip_on_branch_re.match(branch):
             print "Release Candidate Build, leaving version files untouched."
             return 0
-- 
cgit v1.2.3