summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-08-27 01:41:29 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-08-27 01:41:29 +0000
commit634f2c36033e59883eb1ef11aafa73c339c4c4ba (patch)
tree8a2bb8d632428c8153e822986f665390c499ae41 /bin
parente271af52bf0a7ac9796bafb04052ee073cd40738 (diff)
Check if the SVN_DIR is actually a git dir, and change accordingly
Diffstat (limited to 'bin')
-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