summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/rbot32
1 files changed, 18 insertions, 14 deletions
diff --git a/bin/rbot b/bin/rbot
index 744944e0..c6d62daa 100755
--- a/bin/rbot
+++ b/bin/rbot
@@ -42,22 +42,26 @@ $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}"
+ if defined?(SVN_DIR) and File.exists?(File.join(SVN_DIR, '.git'))
+ $version.sub!('svn', 'git')
+ else
+ 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 =~ /^[MDA] /
+ rev << ", local changes"
+ end
+ rev << ")"
+ rescue => e
+ puts e.inspect
end
- svn_st = `svn st #{up}`
- if svn_st =~ /^[MDA] /
- rev << ", local changes"
- end
- rev << ")"
- rescue => e
- puts e.inspect
+ $version += rev
end
- $version += rev
end
orig_opts = ARGV.dup