scm: mercurial: switch shell quote revision with argument.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4828 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
8b3a8d73be
commit
62ea9bd915
|
@ -93,7 +93,7 @@ module Redmine
|
||||||
path ||= ''
|
path ||= ''
|
||||||
entries = Entries.new
|
entries = Entries.new
|
||||||
cmd = "#{self.class.sq_bin} -R #{target('')} --cwd #{target('')} locate"
|
cmd = "#{self.class.sq_bin} -R #{target('')} --cwd #{target('')} locate"
|
||||||
cmd << " -r #{hgrev(identifier)}"
|
cmd << " -r #{hgrev(identifier, true)}"
|
||||||
cmd << " " + shell_quote("path:#{path}") unless path.empty?
|
cmd << " " + shell_quote("path:#{path}") unless path.empty?
|
||||||
shellout(cmd) do |io|
|
shellout(cmd) do |io|
|
||||||
io.each_line do |line|
|
io.each_line do |line|
|
||||||
|
@ -120,9 +120,9 @@ module Redmine
|
||||||
revisions = Revisions.new
|
revisions = Revisions.new
|
||||||
cmd = "#{self.class.sq_bin} --debug --encoding utf8 -R #{target('')} log -C --style #{shell_quote self.class.template_path}"
|
cmd = "#{self.class.sq_bin} --debug --encoding utf8 -R #{target('')} log -C --style #{shell_quote self.class.template_path}"
|
||||||
if identifier_from && identifier_to
|
if identifier_from && identifier_to
|
||||||
cmd << " -r #{hgrev(identifier_from)}:#{hgrev(identifier_to)}"
|
cmd << " -r #{hgrev(identifier_from, true)}:#{hgrev(identifier_to, true)}"
|
||||||
elsif identifier_from
|
elsif identifier_from
|
||||||
cmd << " -r #{hgrev(identifier_from)}:"
|
cmd << " -r #{hgrev(identifier_from, true)}:"
|
||||||
end
|
end
|
||||||
cmd << " --limit #{options[:limit].to_i}" if options[:limit]
|
cmd << " --limit #{options[:limit].to_i}" if options[:limit]
|
||||||
cmd << " #{shell_quote path}" unless path.blank?
|
cmd << " #{shell_quote path}" unless path.blank?
|
||||||
|
@ -168,10 +168,10 @@ module Redmine
|
||||||
diff_args = ''
|
diff_args = ''
|
||||||
diff = []
|
diff = []
|
||||||
if identifier_to
|
if identifier_to
|
||||||
diff_args = "-r #{hgrev(identifier_to)} -r #{hgrev(identifier_from)}"
|
diff_args = "-r #{hgrev(identifier_to, true)} -r #{hgrev(identifier_from, true)}"
|
||||||
else
|
else
|
||||||
if self.class.client_version_above?([1, 2])
|
if self.class.client_version_above?([1, 2])
|
||||||
diff_args = "-c #{hgrev(identifier_from)}"
|
diff_args = "-c #{hgrev(identifier_from, true)}"
|
||||||
else
|
else
|
||||||
return []
|
return []
|
||||||
end
|
end
|
||||||
|
@ -189,7 +189,7 @@ module Redmine
|
||||||
|
|
||||||
def cat(path, identifier=nil)
|
def cat(path, identifier=nil)
|
||||||
cmd = "#{self.class.sq_bin} -R #{target('')} cat"
|
cmd = "#{self.class.sq_bin} -R #{target('')} cat"
|
||||||
cmd << " -r #{hgrev(identifier)}"
|
cmd << " -r #{hgrev(identifier, true)}"
|
||||||
cmd << " #{target(path)}"
|
cmd << " #{target(path)}"
|
||||||
cat = nil
|
cat = nil
|
||||||
shellout(cmd) do |io|
|
shellout(cmd) do |io|
|
||||||
|
@ -204,7 +204,7 @@ module Redmine
|
||||||
path ||= ''
|
path ||= ''
|
||||||
cmd = "#{self.class.sq_bin} -R #{target('')}"
|
cmd = "#{self.class.sq_bin} -R #{target('')}"
|
||||||
cmd << " annotate -ncu"
|
cmd << " annotate -ncu"
|
||||||
cmd << " -r #{hgrev(identifier)}"
|
cmd << " -r #{hgrev(identifier, true)}"
|
||||||
cmd << " #{target(path)}"
|
cmd << " #{target(path)}"
|
||||||
blame = Annotate.new
|
blame = Annotate.new
|
||||||
shellout(cmd) do |io|
|
shellout(cmd) do |io|
|
||||||
|
@ -227,8 +227,10 @@ module Redmine
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns correct revision identifier
|
# Returns correct revision identifier
|
||||||
def hgrev(identifier)
|
def hgrev(identifier, sq=false)
|
||||||
shell_quote(identifier.blank? ? 'tip' : identifier.to_s)
|
rev = identifier.blank? ? 'tip' : identifier.to_s
|
||||||
|
rev = shell_quote(rev) if sq
|
||||||
|
rev
|
||||||
end
|
end
|
||||||
private :hgrev
|
private :hgrev
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue