From 05b292030ca67b3ca6a6db1a39903a098380fb9a Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Wed, 25 May 2011 07:46:03 +0000 Subject: [PATCH] scm: bazaar: add adapter method to get .bzr/branch/branch.conf path from specified path (#2799, #4741, #8030). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5890 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/scm/adapters/bazaar_adapter.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/redmine/scm/adapters/bazaar_adapter.rb b/lib/redmine/scm/adapters/bazaar_adapter.rb index 8eb5f93c3..804833a2a 100644 --- a/lib/redmine/scm/adapters/bazaar_adapter.rb +++ b/lib/redmine/scm/adapters/bazaar_adapter.rb @@ -220,6 +220,20 @@ module Redmine return nil if $? && $?.exitstatus != 0 blame end + + def self.branch_conf_path(path) + bcp = nil + m = path.match(%r{^(.*[/\\])\.bzr.*$}) + if m + bcp = m[1] + else + bcp = path + end + bcp.gsub!(/[\/\\]$/, "") + if bcp + bcp = File.join(bcp, ".bzr", "branch", "branch.conf") + end + end end end end