Mercurial > hg > soundsoftware-site
comparison lib/redmine/version.rb @ 1568:bc47b68a9487 live
Avoid spurious svn invocation on startup
author | Chris Cannam |
---|---|
date | Tue, 01 Aug 2017 13:30:33 +0100 |
parents | fb9a13467253 |
children |
comparison
equal
deleted
inserted
replaced
1567:3ad53f43483d | 1568:bc47b68a9487 |
---|---|
12 # * trunk: devel | 12 # * trunk: devel |
13 BRANCH = 'stable' | 13 BRANCH = 'stable' |
14 | 14 |
15 # Retrieves the revision from the working copy | 15 # Retrieves the revision from the working copy |
16 def self.revision | 16 def self.revision |
17 if File.directory?(File.join(Rails.root, '.svn')) | 17 return 0 |
18 begin | 18 # if File.directory?(File.join(Rails.root, '.svn')) |
19 path = Redmine::Scm::Adapters::AbstractAdapter.shell_quote(Rails.root.to_s) | 19 # begin |
20 if `svn info --xml #{path}` =~ /revision="(\d+)"/ | 20 # path = Redmine::Scm::Adapters::AbstractAdapter.shell_quote(Rails.root.to_s) |
21 return $1.to_i | 21 # if `svn info --xml #{path}` =~ /revision="(\d+)"/ |
22 end | 22 # return $1.to_i |
23 rescue | 23 # end |
24 # rescue | |
24 # Could not find the current revision | 25 # Could not find the current revision |
25 end | 26 # end |
26 end | 27 # end |
27 nil | 28 # nil |
28 end | 29 end |
29 | 30 |
30 REVISION = self.revision | 31 REVISION = self.revision |
31 ARRAY = [MAJOR, MINOR, TINY, BRANCH, REVISION].compact | 32 ARRAY = [MAJOR, MINOR, TINY, BRANCH, REVISION].compact |
32 STRING = ARRAY.join('.') | 33 STRING = ARRAY.join('.') |