diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-05-25 08:05:58 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-05-25 08:05:58 +0000 |
commit | 8b032bccf1583f9024a19811d4f39d71f6b58d81 (patch) | |
tree | 73d850ff0dd8ad4d4ffd8007f9b9b478f5da444f /lib/redmine/scm/adapters | |
parent | 58820a1e902af29a726b7135f38811fcd5e4e2ed (diff) | |
download | redmine-8b032bccf1583f9024a19811d4f39d71f6b58d81.tar.gz redmine-8b032bccf1583f9024a19811d4f39d71f6b58d81.zip |
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
Diffstat (limited to 'lib/redmine/scm/adapters')
-rw-r--r-- | lib/redmine/scm/adapters/bazaar_adapter.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/redmine/scm/adapters/bazaar_adapter.rb b/lib/redmine/scm/adapters/bazaar_adapter.rb index 804833a2a..822d51773 100644 --- a/lib/redmine/scm/adapters/bazaar_adapter.rb +++ b/lib/redmine/scm/adapters/bazaar_adapter.rb @@ -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 |