scm: mercurial: fix Ruby 1.9 "hg diff" test fails (#7518).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4859 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-02-16 16:06:24 +00:00
parent 0a87041504
commit 7a3d385b8e
1 changed files with 5 additions and 2 deletions

View File

@ -170,10 +170,13 @@ module Redmine
hg_args << '-c' << hgrev(identifier_from)
end
hg_args << CGI.escape(hgtarget(path)) unless path.blank?
diff = []
hg *hg_args do |io|
io.collect
io.each_line do |line|
diff << line
end
end
diff
rescue HgCommandAborted
nil # means not found
end