scm: bazaar: add adapter method to get "append_revisions_only" value from .bzr/branch/branch.conf (#2799, #4741, #8030).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5892 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-05-25 08:05:58 +00:00
parent 58820a1e90
commit 8b032bccf1
1 changed files with 32 additions and 0 deletions

View File

@ -234,6 +234,38 @@ module Redmine
bcp = File.join(bcp, ".bzr", "branch", "branch.conf")
end
end
def append_revisions_only
return @aro if ! @aro.nil?
@aro = false
bcp = self.class.branch_conf_path(url)
if File.exist?(bcp)
begin
f = File::open(bcp, "r")
cnt = 0
f.each_line do |line|
l = line.chomp.to_s
if l =~ /^\s*append_revisions_only\s*=\s*(\w+)\s*$/
str_aro = $1
if str_aro.upcase == "TRUE"
@aro = true
cnt += 1
elsif str_aro.upcase == "FALSE"
@aro = false
cnt += 1
end
if cnt > 1
@aro = false
break
end
end
end
ensure
f.close
end
end
@aro
end
end
end
end