From 8cf6c61795500ea114da0e5da1bdf704eb6f22bb Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Mon, 11 Mar 2013 18:49:17 +0100 Subject: [PATCH] add support for darcs repos --- README.md | 2 +- doc/signify.txt | 1 + plugin/signify.vim | 17 ++++++++++++++--- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 96f3fb5..a0164ff 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ It's fast, highly configurable and well documented. Features: -- supports git, mercurial, bazaar, subversion, cvs +- supports git, mercurial, darcs, bazaar, subversion, cvs - apart from signs there is also optional line highlighting - fully configurable through global variables - optional preserving of signs from other plugins diff --git a/doc/signify.txt b/doc/signify.txt index b85fa4e..2fd2845 100644 --- a/doc/signify.txt +++ b/doc/signify.txt @@ -48,6 +48,7 @@ version control system: - git - mercurial + - darcs - bzr - subversion - cvs diff --git a/plugin/signify.vim b/plugin/signify.vim index 95c6a01..05bdeb1 100644 --- a/plugin/signify.vim +++ b/plugin/signify.vim @@ -156,7 +156,7 @@ function! s:start(path) abort endif " Use git's diff cmd to set our signs. - call s:process_diff(a:path, diff) + call s:diff_process(a:path, diff) let s:sy[a:path].id_top = (s:id_top - 1) endfunction @@ -261,6 +261,17 @@ function! s:diff_get(path) abort return diff endif endif + + if executable('darcs') + let orig_dir = getcwd() + exe 'cd '. fnamemodify(a:path, ':h') + let diff = system('darcs diff --no-pause-for-gui --diff-command="diff -U0 %1 %2" '. a:path .' | grep "^@@ "') + if !v:shell_error + exe 'cd '. orig_dir + return diff + endif + exe 'cd '. orig_dir + endif endif if exists('g:signify_enable_cvs') && (g:signify_enable_cvs == 1) @@ -275,8 +286,8 @@ function! s:diff_get(path) abort return [] endfunction -" Functions -> s:process_diff() {{{2 -function! s:process_diff(path, diff) abort +" Functions -> s:diff_process() {{{2 +function! s:diff_process(path, diff) abort " Determine where we have to put our signs. for line in split(a:diff, '\n') " Parse diff output.