]> source.dussan.org Git - redmine.git/commitdiff
Fixed: Darcs adapter works on Win32 only (wrong quotes in commands #2402).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 4 Jan 2009 13:24:56 +0000 (13:24 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 4 Jan 2009 13:24:56 +0000 (13:24 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.8-stable@2231 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/scm/adapters/darcs_adapter.rb

index 658f0605559213ae09452e14252e74dd7b749bf2..1cf792fb818699795e577ddb47185ba0f3e38c49 100644 (file)
@@ -67,8 +67,8 @@ module Redmine
           path = '.' if path.blank?
           entries = Entries.new          
           cmd = "#{DARCS_BIN} annotate --repodir #{@url} --xml-output"
-          cmd << " --match \"hash #{identifier}\"" if identifier
-          cmd << " #{path}"
+          cmd << " --match #{shell_quote("hash #{identifier}")}" if identifier
+          cmd << " #{shell_quote path}"
           shellout(cmd) do |io|
             begin
               doc = REXML::Document.new(io)
@@ -91,7 +91,7 @@ module Redmine
           path = '.' if path.blank?
           revisions = Revisions.new
           cmd = "#{DARCS_BIN} changes --repodir #{@url} --xml-output"
-          cmd << " --from-match \"hash #{identifier_from}\"" if identifier_from
+          cmd << " --from-match #{shell_quote("hash #{identifier_from}")}" if identifier_from
           cmd << " --last #{options[:limit].to_i}" if options[:limit]
           shellout(cmd) do |io|
             begin
@@ -118,12 +118,12 @@ module Redmine
           path = '*' if path.blank?
           cmd = "#{DARCS_BIN} diff --repodir #{@url}"
           if identifier_to.nil?
-            cmd << " --match \"hash #{identifier_from}\""
+            cmd << " --match #{shell_quote("hash #{identifier_from}")}"
           else
-            cmd << " --to-match \"hash #{identifier_from}\""
-            cmd << " --from-match \"hash #{identifier_to}\""
+            cmd << " --to-match #{shell_quote("hash #{identifier_from}")}"
+            cmd << " --from-match #{shell_quote("hash #{identifier_to}")}"
           end
-          cmd << " -u #{path}"
+          cmd << " -u #{shell_quote path}"
           diff = []
           shellout(cmd) do |io|
             io.each_line do |line|
@@ -136,7 +136,7 @@ module Redmine
         
         def cat(path, identifier=nil)
           cmd = "#{DARCS_BIN} show content --repodir #{@url}"
-          cmd << " --match \"hash #{identifier}\"" if identifier
+          cmd << " --match #{shell_quote("hash #{identifier}")}" if identifier
           cmd << " #{shell_quote path}"
           cat = nil
           shellout(cmd) do |io|
@@ -171,7 +171,7 @@ module Redmine
         # Retrieve changed paths for a single patch
         def get_paths_for_patch(hash)
           cmd = "#{DARCS_BIN} annotate --repodir #{@url} --summary --xml-output"
-          cmd << " --match \"hash #{hash}\" "
+          cmd << " --match #{shell_quote("hash #{hash}")} "
           paths = []
           shellout(cmd) do |io|
             begin