From bc811c4ff356d27ed2d16eac2c8c16afd034510e Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Wed, 3 Sep 2008 13:19:27 +0000 Subject: [PATCH] Narrow diffs to the modified files. git-svn-id: https://svn.cambridge.iain.cx/profile/trunk@145 6be0d1a5-5cfe-0310-89b6-964be062b18b --- .vim/script/p4 | 5 ++++- .vim/script/svn | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.vim/script/p4 b/.vim/script/p4 index ecaacaf..f7cabe5 100644 --- a/.vim/script/p4 +++ b/.vim/script/p4 @@ -15,9 +15,12 @@ fun! P4submit() " Allow closing an unmodified spec. set nomod + " Get the files in the changelist. + let l:files = system("sed -n 's/ #.*//p' " . bufname("")) + " Create a new window, move it below the spec and read in a diff. botright new - r!env P4DIFF= p4 diff -du + exe "r!env P4DIFF= p4 diff -du " . substitute(l:files, "\n", "", "g") setf diff " Delete the blank line left above the diff. diff --git a/.vim/script/svn b/.vim/script/svn index 3dd61a3..194b487 100644 --- a/.vim/script/svn +++ b/.vim/script/svn @@ -5,9 +5,12 @@ fun! SVNcommit() " Allow closing an unmodified spec. set nomod + " Get the modified files. + let l:files = system("sed '1,/^$/d;s/^[MR]....//' " . bufname("")) + " Create a new window, move it below the spec and read in a diff. botright new - r!svn diff + exe "r!svn diff " . substitute(l:files, "\n", " ", "g") setf diff " Delete the blank line left above the diff. -- 2.7.4