summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-09-01 16:06:39 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-09-01 16:06:39 +0000
commit5994535a9fd47190a54ac1a0d723cd64ec713641 (patch)
tree39a4feea44b8f698aaf9f91eb17733b0a0ef91de
parent3462b9d3909635affe9561b476fd7a5326d53709 (diff)
rbot now tries to report svn revision when ran from a svn checkout
-rw-r--r--ChangeLog2
-rwxr-xr-xbin/rbot19
2 files changed, 21 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 28fec77b..941bb6e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
* New Auth Framework: document and fine tune permissions view the auth
core botmodule.
+ * Version: when run from a svn checkout, the bot now tries to report
+ which svn revision it's at, and if there are local changes
2006-08-31 Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
diff --git a/bin/rbot b/bin/rbot
index ce5c86bd..8fba53d6 100755
--- a/bin/rbot
+++ b/bin/rbot
@@ -32,6 +32,25 @@ require 'fileutils'
$version="0.9.11-svn"
$opts = Hash.new
+if $version =~ /svn/
+ up = File.dirname(__FILE__) + "/.."
+ rev = " (unknown revision)"
+ begin
+ svn_out = `svn info #{up}`
+ if svn_out =~ /Last Changed Rev: (\d+)/
+ rev = " (revision #{$1}"
+ end
+ svn_st = `svn st #{up}`
+ if svn_st =~ /^M /
+ rev << ", local changes"
+ end
+ rev << ")"
+ rescue => e
+ puts e.inspect
+ end
+ $version += rev
+end
+
orig_opts = ARGV.dup
opts = GetoptLong.new(