Add experimental perforce support

This commit is contained in:
Marco Hinz 2013-07-29 21:15:07 +02:00
parent c4df9a3895
commit 747e12aed3

View File

@ -26,7 +26,7 @@ endif
" Function: #detect {{{1
function! sy#repo#detect(path) abort
for type in get(g:, 'signify_vcs_list', [ 'git', 'hg', 'svn', 'darcs', 'bzr', 'fossil', 'cvs', 'rcs', 'accurev' ])
for type in get(g:, 'signify_vcs_list', [ 'git', 'hg', 'svn', 'darcs', 'bzr', 'fossil', 'cvs', 'rcs', 'accurev', 'perforce' ])
let diff = sy#repo#get_diff_{type}(a:path)
if !empty(diff)
return [ diff, type ]
@ -139,6 +139,14 @@ function! sy#repo#get_diff_accurev(path) abort
endif
endfunction
" Function: #get_diff_perforce {{{1
function! sy#repo#get_diff_perforce(path) abort
if executable('perforce')
let diff = system('env P4DIFF=diff p4 diff -dU0 -- '. sy#util#escape(a:path))
return v:shell_error ? '' : diff
endif
endfunction
" Function: #process_diff {{{1
function! sy#repo#process_diff(path, diff) abort
" Determine where we have to put our signs.