@@ -140,7 +140,7 @@ def summary
140140
141141 def entries ( path = nil , identifier = nil , options = { } )
142142 p1 = scm_iconv ( @path_encoding , 'UTF-8' , path )
143- manifest = hg ( 'rhmanifest' , '-r' , CGI . escape ( hgrev ( identifier ) ) ,
143+ manifest = hg ( 'rhmanifest' , "-r #{ CGI . escape ( hgrev ( identifier ) ) } " ,
144144 '--' , CGI . escape ( without_leading_slash ( p1 . to_s ) ) ) do |io |
145145 output = io . read . force_encoding ( 'UTF-8' )
146146 begin
@@ -181,9 +181,9 @@ def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={})
181181 # Iterates the revisions by using a template file that
182182 # makes Mercurial produce a xml output.
183183 def each_revision ( path = nil , identifier_from = nil , identifier_to = nil , options = { } )
184- hg_args = [ 'log' , '--debug' , '-C' , ' --style' , self . class . template_path ]
185- hg_args << '-r' << " #{ hgrev ( identifier_from ) } :#{ hgrev ( identifier_to ) } "
186- hg_args << ' --limit' << options [ :limit ] if options [ :limit ]
184+ hg_args = [ 'log' , '--debug' , '-C' , " --style= #{ self . class . template_path } " ]
185+ hg_args << "-r #{ hgrev ( identifier_from ) } :#{ hgrev ( identifier_to ) } "
186+ hg_args << " --limit= #{ options [ :limit ] } " if options [ :limit ]
187187 hg_args << '--' << hgtarget ( path ) unless path . blank?
188188 log = hg ( *hg_args ) do |io |
189189 output = io . read . force_encoding ( 'UTF-8' )
@@ -224,19 +224,19 @@ def each_revision(path=nil, identifier_from=nil, identifier_to=nil, options={})
224224
225225 # Returns list of nodes in the specified branch
226226 def nodes_in_branch ( branch , options = { } )
227- hg_args = [ 'rhlog' , '--template' , ' {node}\n', ' --rhbranch' , CGI . escape ( branch ) ]
228- hg_args << ' --from' << CGI . escape ( branch )
229- hg_args << '--to' << ' 0'
230- hg_args << ' --limit' << options [ :limit ] if options [ :limit ]
227+ hg_args = [ 'rhlog' , '--template= {node}\n' , " --rhbranch= #{ CGI . escape ( branch ) } " ]
228+ hg_args << " --from= #{ CGI . escape ( branch ) } "
229+ hg_args << '--to= 0'
230+ hg_args << " --limit= #{ options [ :limit ] } " if options [ :limit ]
231231 hg ( *hg_args ) { |io | io . readlines . map { |e | e . chomp } }
232232 end
233233
234234 def diff ( path , identifier_from , identifier_to = nil )
235235 hg_args = %w| rhdiff |
236236 if identifier_to
237- hg_args << '-r' << hgrev ( identifier_to ) << '-r' << hgrev ( identifier_from )
237+ hg_args << "-r #{ hgrev ( identifier_to ) } " << "-r #{ hgrev ( identifier_from ) } "
238238 else
239- hg_args << '-c' << hgrev ( identifier_from )
239+ hg_args << "-c #{ hgrev ( identifier_from ) } "
240240 end
241241 unless path . blank?
242242 p = scm_iconv ( @path_encoding , 'UTF-8' , path )
@@ -255,7 +255,7 @@ def diff(path, identifier_from, identifier_to=nil)
255255
256256 def cat ( path , identifier = nil )
257257 p = CGI . escape ( scm_iconv ( @path_encoding , 'UTF-8' , path ) )
258- hg 'rhcat' , '-r' , CGI . escape ( hgrev ( identifier ) ) , '--' , hgtarget ( p ) do |io |
258+ hg 'rhcat' , "-r #{ CGI . escape ( hgrev ( identifier ) ) } " , '--' , hgtarget ( p ) do |io |
259259 io . binmode
260260 io . read
261261 end
@@ -266,7 +266,7 @@ def cat(path, identifier=nil)
266266 def annotate ( path , identifier = nil )
267267 p = CGI . escape ( scm_iconv ( @path_encoding , 'UTF-8' , path ) )
268268 blame = Annotate . new
269- hg 'rhannotate' , '-ncu' , '-r' , CGI . escape ( hgrev ( identifier ) ) , '--' , hgtarget ( p ) do |io |
269+ hg 'rhannotate' , '-ncu' , "-r #{ CGI . escape ( hgrev ( identifier ) ) } " , '--' , hgtarget ( p ) do |io |
270270 io . each_line do |line |
271271 line . force_encoding ( 'ASCII-8BIT' )
272272 next unless line =~ %r{^([^:]+)\s (\d +)\s ([0-9a-f]+):\s (.*)$}
@@ -304,7 +304,8 @@ def hg(*args, &block)
304304 end
305305
306306 repo_path = root_url || url
307- full_args = [ '-R' , repo_path , '--encoding' , 'utf-8' ]
307+ full_args = [ "-R#{ repo_path } " , '--encoding=utf-8' ]
308+ # don't use "--config=<value>" form for compatibility with ancient Mercurial
308309 full_args << '--config' << "extensions.redminehelper=#{ HG_HELPER_EXT } "
309310 full_args << '--config' << 'diff.git=false'
310311 full_args += args
0 commit comments