summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-03-13 00:48:07 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-03-13 00:48:07 +0000
commitb914a3648ace461e34b45a1cb2d163b1c20e229a (patch)
treeb0e19dcdc16b3c4edab32eb0f51fb0e2ce93c8f7 /lib
parent2e2055c05114f371a84b5581beb87f290a9bf4ed (diff)
downloadredmine-b914a3648ace461e34b45a1cb2d163b1c20e229a.tar.gz
redmine-b914a3648ace461e34b45a1cb2d163b1c20e229a.zip
scm: mercurial: add new "nodes_in_branch()" method in adapter (#7246, #4455).
For latest changesets supporting named branch. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5102 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/scm/adapters/mercurial_adapter.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/redmine/scm/adapters/mercurial_adapter.rb b/lib/redmine/scm/adapters/mercurial_adapter.rb
index 6a2613fcf..df021ea1c 100644
--- a/lib/redmine/scm/adapters/mercurial_adapter.rb
+++ b/lib/redmine/scm/adapters/mercurial_adapter.rb
@@ -219,6 +219,17 @@ module Redmine
self
end
+ # Returns list of nodes in the specified branch
+ def nodes_in_branch(branch, path=nil, identifier_from=nil, identifier_to=nil, options={})
+ p1 = scm_iconv(@path_encoding, 'UTF-8', path)
+ hg_args = ['rhlog', '--template', '{node|short}\n', '--rhbranch', CGI.escape(branch)]
+ hg_args << '--from' << CGI.escape(hgrev(identifier_from))
+ hg_args << '--to' << CGI.escape(hgrev(identifier_to))
+ hg_args << '--limit' << options[:limit] if options[:limit]
+ hg_args << CGI.escape(hgtarget(p1)) unless path.blank?
+ hg(*hg_args) { |io| io.readlines.map { |e| e.chomp } }
+ end
+
def diff(path, identifier_from, identifier_to=nil)
hg_args = %w|rhdiff|
if identifier_to