get_diff_hg: Disable color extension

This handles the case where a user forces colors from the color extension via
hgrc:

    [extensions]
    color =

    [defaults]
    diff = --colors=always

Sy disables these for its 'hg diff' call, otherwise the output would be
riddled with color escape sequences and couldn't be parsed properly which
would result in no signs shown.

References #146.
This commit is contained in:
Marco Hinz 2014-11-23 07:23:08 +01:00
parent 6d45797393
commit 52cb36801d

View File

@ -104,7 +104,7 @@ endfunction
" Function: #get_diff_hg {{{1
function! sy#repo#get_diff_hg() abort
let diffoptions = has_key(g:signify_diffoptions, 'hg') ? g:signify_diffoptions.hg : ''
let diff = sy#util#run_in_dir(fnamemodify(b:sy.path, ':h'), 'hg diff --nodates -U0 '. diffoptions .' -- '. sy#util#escape(b:sy.path))
let diff = sy#util#run_in_dir(fnamemodify(b:sy.path, ':h'), 'hg diff --config extensions.color=! --config defaults.diff= --nodates -U0 '. diffoptions .' -- '. sy#util#escape(b:sy.path))
return v:shell_error ? [0, ''] : [1, diff]
endfunction