summaryrefslogtreecommitdiffstats
path: root/lib/redmine/scm/adapters/bazaar_adapter.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-05-25 07:46:03 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-05-25 07:46:03 +0000
commit05b292030ca67b3ca6a6db1a39903a098380fb9a (patch)
treefcf9c432f399742b68fb3d2ed8097799a694c4b1 /lib/redmine/scm/adapters/bazaar_adapter.rb
parent228ac57ada2c8b99ba6b8bb883c44df316047a21 (diff)
downloadredmine-05b292030ca67b3ca6a6db1a39903a098380fb9a.tar.gz
redmine-05b292030ca67b3ca6a6db1a39903a098380fb9a.zip
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
Diffstat (limited to 'lib/redmine/scm/adapters/bazaar_adapter.rb')
-rw-r--r--lib/redmine/scm/adapters/bazaar_adapter.rb14
1 files changed, 14 insertions, 0 deletions
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