diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-03-11 20:06:25 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-03-11 20:06:25 +0000 |
commit | 71d3bb2f7b9788264c1b110a4eee3be46c2d5f49 (patch) | |
tree | 475cd9642a904fe3b3dce2b6eee2794c072cf770 /lib | |
parent | 624723d0cef9bd8a9528745f4b75ee22f6b1ad2e (diff) | |
download | redmine-71d3bb2f7b9788264c1b110a4eee3be46c2d5f49.tar.gz redmine-71d3bb2f7b9788264c1b110a4eee3be46c2d5f49.zip |
Fixes Mercurial browsing under unix-like os and for directory depth > 2 and (patch #826 by Frederic Moulins, slightly edited to preserve win32 compatibility).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1228 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine/scm/adapters/mercurial_adapter.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/redmine/scm/adapters/mercurial_adapter.rb b/lib/redmine/scm/adapters/mercurial_adapter.rb index 3c905fc0f..40d570d05 100644 --- a/lib/redmine/scm/adapters/mercurial_adapter.rb +++ b/lib/redmine/scm/adapters/mercurial_adapter.rb @@ -43,12 +43,12 @@ module Redmine def entries(path=nil, identifier=nil) path ||= '' entries = Entries.new - cmd = "#{HG_BIN} -R #{target('')} --cwd #{target(path)} locate -X */*/*" + cmd = "#{HG_BIN} -R #{target('')} --cwd #{target(path)} locate" cmd << " -r #{identifier.to_i}" if identifier - cmd << " * */*" + cmd << " glob:**" shellout(cmd) do |io| io.each_line do |line| - e = line.chomp.split('\\') + e = line.chomp.split(%r{[\/\\]}) entries << Entry.new({:name => e.first, :path => (path.empty? ? e.first : "#{path}/#{e.first}"), :kind => (e.size > 1 ? 'dir' : 'file'), |