# HG changeset patch # User Ludovic Chabant # Date 1455925196 28800 # Node ID 96e4423e729e3845a30315f045c6229b4977900d # Parent bbb19d37c681e95dd1d97228ce2a65c268b9d163# Parent 47209552ec469329456ef44431d08b034f2d86cd Merge pull request #7 from GitHub. diff -r bbb19d37c681 -r 96e4423e729e plugin/lawrencium.vim --- a/plugin/lawrencium.vim Tue Feb 16 22:44:44 2016 -0800 +++ b/plugin/lawrencium.vim Fri Feb 19 15:39:56 2016 -0800 @@ -61,11 +61,6 @@ return fnamemodify(a:path, ':s?[/\\]$??') endfunction -" Surrounds the given string with double quotes. -function! s:addquotes(str) - return '"' . a:str . '"' -endfunction - " Returns whether a path is absolute. function! s:isabspath(path) return a:path =~# '\v^(\w\:)?[/\\]' @@ -361,11 +356,7 @@ let l:hg_command = g:lawrencium_hg_executable . ' --repository ' . shellescape(s:stripslash(self.root_dir)) let l:hg_command = l:hg_command . ' ' . a:command for l:arg in l:arg_list - if stridx(l:arg, ' ') >= 0 - let l:hg_command = l:hg_command . ' "' . l:arg . '"' - else - let l:hg_command = l:hg_command . ' ' . l:arg - endif + let l:hg_command = l:hg_command . ' ' . shellescape(l:arg) endfor if l:prev_shellslash setlocal shellslash @@ -690,7 +681,7 @@ if l:rev == '' call a:repo.ReadCommandOutput('cat', a:full_path) else - call a:repo.ReadCommandOutput('cat', '-r', s:addquotes(l:rev), a:full_path) + call a:repo.ReadCommandOutput('cat', '-r', l:rev, a:full_path) endif endfunction @@ -730,11 +721,11 @@ let l:rev1 = strpart(a:path_parts['value'], 0, l:commaidx) let l:rev2 = strpart(a:path_parts['value'], l:commaidx + 1) if l:rev1 == '-' - let l:diffargs = [ '-r', s:addquotes(l:rev2) ] + let l:diffargs = [ '-r', l:rev2 ] elseif l:rev2 == '-' - let l:diffargs = [ '-r', s:addquotes(l:rev1) ] + let l:diffargs = [ '-r', l:rev1 ] else - let l:diffargs = [ '-r', s:addquotes(l:rev1), '-r', s:addquotes(l:rev2) ] + let l:diffargs = [ '-r', l:rev1, '-r', l:rev2 ] endif elseif a:path_parts['value'] != '' let l:diffargs = [ '-c', a:path_parts['value'] ]