Defect #2664 » hg-ruby-1.9.diff
| lib/redmine/scm/adapters/abstract_adapter.rb | ||
|---|---|---|
|
|
||
|
# 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)
|
||
|
def entry(path=nil, identifier=nil, path_encoding='UTF-8')
|
||
|
parts = path.to_s.split(%r{[\/\\]}).select {|n| !n.blank?}
|
||
|
search_path = parts[0..-2].join('/')
|
||
|
search_name = parts[-1]
|
||
| ... | ... | |
|
Entry.new(:path => '', :kind => 'dir')
|
||
|
else
|
||
|
# Search for the entry in the parent directory
|
||
|
es = entries(search_path, identifier)
|
||
|
es = entries(search_path, identifier, path_encoding)
|
||
|
es ? es.detect {|e| e.name == search_name} : 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)
|
||
|
def entries(path=nil, identifier=nil, path_encoding='UTF-8')
|
||
|
return nil
|
||
|
end
|
||
| lib/redmine/scm/adapters/mercurial_adapter.rb | ||
|---|---|---|
|
return nil
|
||
|
end
|
||
|
def entries(path=nil, identifier=nil)
|
||
|
def entries(path=nil, identifier=nil, path_encoding='UTF-8')
|
||
|
path ||= ''
|
||
|
entries = Entries.new
|
||
|
cmd = "#{HG_BIN} -R #{target('')} --cwd #{target('')} locate"
|
||
| ... | ... | |
|
shellout(cmd) do |io|
|
||
|
io.each_line do |line|
|
||
|
# HG uses antislashs as separator on Windows
|
||
|
if line.respond_to?(:force_encoding)
|
||
|
line.force_encoding(path_encoding)
|
||
|
end
|
||
|
line = line.gsub(/\\/, "/")
|
||
|
if path.empty? or e = line.gsub!(%r{^#{with_trailling_slash(path)}},'')
|
||
|
e ||= line
|
||
| lib/redmine/scm/adapters/path_encodable_wrapper.rb | ||
|---|---|---|
|
@path_encoding = path_encoding
|
||
|
end
|
||
|
def entry(path=nil, identifier=nil)
|
||
|
convert_entry!(super(to_scm_path(path), identifier))
|
||
|
def entry(path=nil, identifier=nil, path_encoding='UTF-8')
|
||
|
convert_entry!(super(to_scm_path(path), identifier, @path_encoding))
|
||
|
end
|
||
|
def entries(path=nil, identifier=nil)
|
||
|
convert_entries!(super(to_scm_path(path), identifier))
|
||
|
def entries(path=nil, identifier=nil, path_encoding='UTF-8')
|
||
|
convert_entries!(super(to_scm_path(path), identifier, @path_encoding))
|
||
|
end
|
||
|
def properties(path, identifier=nil)
|
||