]> source.dussan.org Git - redmine.git/commitdiff
scm: bazaar: add adapter method to get .bzr/branch/branch.conf path from specified...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 25 May 2011 07:46:03 +0000 (07:46 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 25 May 2011 07:46:03 +0000 (07:46 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5890 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/scm/adapters/bazaar_adapter.rb

index 8eb5f93c3713981155f8eb00ab1ca12891dd0fc4..804833a2a6e19506f4448cf8578304e4b29f6ae3 100644 (file)
@@ -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