From f79c9eec82a8feefcb30dea0699036fd279bcbaf Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 14 Sep 2008 16:40:49 -0500 Subject: [PATCH] Changes to buildbot scripts for Mercurial. --- tools/buildbot/helpers.pm | 23 +++++++++++++++++++++-- tools/buildbot/package.pl | 2 +- tools/buildbot/symstore.pl | 2 +- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/tools/buildbot/helpers.pm b/tools/buildbot/helpers.pm index 37bf32c5..704a7b17 100644 --- a/tools/buildbot/helpers.pm +++ b/tools/buildbot/helpers.pm @@ -9,7 +9,26 @@ our $SVN = "/usr/bin/svn"; our $SVN_USER = 'dvander'; our $SVN_ARGS = ''; -sub Revision +sub HgRevNum +{ + my ($path) = (@_); + my ($cd, $text, $rev); + + $cd = Cwd::cwd(); + chdir($path); + $text = `hg identify -n`; + chdir($cd); + + chomp $text; + if ($text =~ /^(\d+)/) + { + return $1; + } + + return 0; +} + +sub SvnRevNum { my ($str)=(@_); @@ -123,4 +142,4 @@ sub SVN_Add chdir($dir); } -return 1; \ No newline at end of file +return 1; diff --git a/tools/buildbot/package.pl b/tools/buildbot/package.pl index 9d09f90c..88c276b2 100755 --- a/tools/buildbot/package.pl +++ b/tools/buildbot/package.pl @@ -32,7 +32,7 @@ chdir(Build::PathFormat('../../OUTPUT/base')); my ($version); $version = Build::ProductVersion(Build::PathFormat('../../product.version')); -$version .= '.' . Build::Revision('../..'); +$version .= '-hg' . Build::HgRevNum('../..'); my ($filename); $filename = 'sourcemod-' . $version; diff --git a/tools/buildbot/symstore.pl b/tools/buildbot/symstore.pl index 891b2b57..06404c6d 100755 --- a/tools/buildbot/symstore.pl +++ b/tools/buildbot/symstore.pl @@ -20,7 +20,7 @@ rsync('sourcemod@alliedmods.net:~/public_html/symbols/', '..\\..\\symstore'); #Get version info my ($version); $version = Build::ProductVersion(Build::PathFormat('product.version')); -$version .= '.' . Build::Revision('.'); +$version .= '-hg' . Build::HgRevNum('.'); my ($line); while ()