mirror of
https://github.com/redmine/redmine.git
synced 2025-11-04 20:35:57 +01:00
Fixed: Links to repository directories don't work (#1119).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1365 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -59,8 +59,17 @@ module Redmine
|
||||
# Returns the entry identified by path and revision identifier
|
||||
# or nil if entry doesn't exist in the repository
|
||||
def entry(path=nil, identifier=nil)
|
||||
e = entries(path, identifier)
|
||||
e ? e.first : nil
|
||||
parts = path.to_s.split(%r{[\/\\]}).select {|n| !n.blank?}
|
||||
search_path = parts[0..-2].join('/')
|
||||
search_name = parts[-1]
|
||||
if search_path.blank? && search_name.blank?
|
||||
# Root entry
|
||||
Entry.new(:path => '', :kind => 'dir')
|
||||
else
|
||||
# Search for the entry in the parent directory
|
||||
es = entries(search_path, identifier)
|
||||
es ? es.detect {|e| e.name == search_name} : nil
|
||||
end
|
||||
end
|
||||
|
||||
# Returns an Entries collection
|
||||
|
||||
@@ -44,18 +44,6 @@ module Redmine
|
||||
return nil
|
||||
end
|
||||
|
||||
# Returns the entry identified by path and revision identifier
|
||||
# or nil if entry doesn't exist in the repository
|
||||
def entry(path=nil, identifier=nil)
|
||||
path ||= ''
|
||||
parts = path.split(%r{[\/\\]}).select {|p| !p.blank?}
|
||||
if parts.size > 0
|
||||
parent = parts[0..-2].join('/')
|
||||
entries = entries(parent, identifier)
|
||||
entries ? entries.detect {|e| e.name == parts.last} : nil
|
||||
end
|
||||
end
|
||||
|
||||
# Returns an Entries collection
|
||||
# or nil if the given path doesn't exist in the repository
|
||||
def entries(path=nil, identifier=nil)
|
||||
|
||||
@@ -55,15 +55,6 @@ module Redmine
|
||||
def get_previous_revision(revision)
|
||||
CvsRevisionHelper.new(revision).prevRev
|
||||
end
|
||||
|
||||
# Returns the entry identified by path and revision identifier
|
||||
# or nil if entry doesn't exist in the repository
|
||||
# this method returns all revisions from one single SCM-Entry
|
||||
def entry(path=nil, identifier="HEAD")
|
||||
e = entries(path, identifier)
|
||||
logger.debug("<cvs-result> #{e.first.inspect}") if e
|
||||
e ? e.first : nil
|
||||
end
|
||||
|
||||
# Returns an Entries collection
|
||||
# or nil if the given path doesn't exist in the repository
|
||||
|
||||
@@ -40,13 +40,6 @@ module Redmine
|
||||
rev ? Info.new({:root_url => @url, :lastrev => rev.last}) : nil
|
||||
end
|
||||
|
||||
# Returns the entry identified by path and revision identifier
|
||||
# or nil if entry doesn't exist in the repository
|
||||
def entry(path=nil, identifier=nil)
|
||||
e = entries(path, identifier)
|
||||
e ? e.first : nil
|
||||
end
|
||||
|
||||
# Returns an Entries collection
|
||||
# or nil if the given path doesn't exist in the repository
|
||||
def entries(path=nil, identifier=nil)
|
||||
|
||||
@@ -132,14 +132,6 @@ module Redmine
|
||||
entries.sort_by_name
|
||||
end
|
||||
|
||||
def entry(path=nil, identifier=nil)
|
||||
path ||= ''
|
||||
search_path = path.split('/')[0..-2].join('/')
|
||||
entry_name = path.split('/').last
|
||||
e = entries(search_path, identifier)
|
||||
e ? e.detect{|entry| entry.name == entry_name} : nil
|
||||
end
|
||||
|
||||
def revisions(path, identifier_from, identifier_to, options={})
|
||||
revisions = Revisions.new
|
||||
cmd = "#{GIT_BIN} --git-dir #{target('')} log --raw "
|
||||
|
||||
@@ -59,14 +59,6 @@ module Redmine
|
||||
return nil if $? && $?.exitstatus != 0
|
||||
entries.sort_by_name
|
||||
end
|
||||
|
||||
def entry(path=nil, identifier=nil)
|
||||
path ||= ''
|
||||
search_path = path.split('/')[0..-2].join('/')
|
||||
entry_name = path.split('/').last
|
||||
e = entries(search_path, identifier)
|
||||
e ? e.detect{|entry| entry.name == entry_name} : nil
|
||||
end
|
||||
|
||||
def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={})
|
||||
revisions = Revisions.new
|
||||
|
||||
@@ -51,13 +51,6 @@ module Redmine
|
||||
return nil
|
||||
end
|
||||
|
||||
# Returns the entry identified by path and revision identifier
|
||||
# or nil if entry doesn't exist in the repository
|
||||
def entry(path=nil, identifier=nil)
|
||||
e = entries(path, identifier)
|
||||
e ? e.first : nil
|
||||
end
|
||||
|
||||
# Returns an Entries collection
|
||||
# or nil if the given path doesn't exist in the repository
|
||||
def entries(path=nil, identifier=nil)
|
||||
|
||||
Reference in New Issue
Block a user