diff --git a/vimfiles/GetLatest/GetLatestVimScripts.dat b/vimfiles/GetLatest/GetLatestVimScripts.dat index 3813b12..5b7f9f7 100644 --- a/vimfiles/GetLatest/GetLatestVimScripts.dat +++ b/vimfiles/GetLatest/GetLatestVimScripts.dat @@ -1,6 +1,6 @@ ScriptID SourceID Filename -------------------------- -1075 9221 netrw.vim +1075 9389 netrw.vim 1502 8743 vimball.vim 1008 3118 srec.vim (ftplugin) 1009 3119 srec.vim (syntax file) @@ -9,7 +9,7 @@ ScriptID SourceID Filename 670 8073 visincr.vim (Visual Increment) 862 2635 cscope_quickfix.vim 51 171 cscope_macros.vim -102 5306 DirDiff.vim +102 9375 DirDiff.vim 1189 8687 matrix.vim 1173 8689 tcomment 948 2878 Scons Compiler plugin @@ -18,7 +18,7 @@ ScriptID SourceID Filename 987 6978 DoxygenToolkit.vim 1397 6887 xml.vim 1290 5190 LogiPat.vim -1881 8355 svndiff +1881 9564 svndiff 1462 5612 dtd2xml 1046 4249 Lusty Explorer 2043 7805 VimPdb (debugging python) @@ -27,8 +27,11 @@ ScriptID SourceID Filename 39 8196 matchit.vim 2092 8095 reloaded.vim (matrix colorscheme) 848 8203 SrchRplcHiGrp.vim (Search/Replace on Syntax Group) -294 8407 Align.vim -479 9276 MultipleSearch -642 8136 :AutoInstall: GetLatestVimScripts.vim -1066 7618 :AutoInstall: cecutil.vim -642 8136 :AutoInstall: getscript.vim +294 9414 Align.vim +479 9276 MultipleSearch +1066 7618 cecutil.vim +642 8136 getscript.vim +90 9279 vcscommand +642 8136 :AutoInstall: GetLatestVimScripts.vim +479 9276 :AutoInstall: MultipleSearch.vba +1173 8689 tComment.vim diff --git a/vimfiles/doc/tags b/vimfiles/doc/tags index 04a37a1..198f3e9 100644 --- a/vimfiles/doc/tags +++ b/vimfiles/doc/tags @@ -1,3 +1,12 @@ +:CVSEdit vcscommand.txt /*:CVSEdit* +:CVSEditors vcscommand.txt /*:CVSEditors* +:CVSUnedit vcscommand.txt /*:CVSUnedit* +:CVSWatch vcscommand.txt /*:CVSWatch* +:CVSWatchAdd vcscommand.txt /*:CVSWatchAdd* +:CVSWatchOff vcscommand.txt /*:CVSWatchOff* +:CVSWatchOn vcscommand.txt /*:CVSWatchOn* +:CVSWatchRemove vcscommand.txt /*:CVSWatchRemove* +:CVSWatchers vcscommand.txt /*:CVSWatchers* :Explore pi_netrw.txt /*:Explore* :GLVS pi_getscript.txt /*:GLVS* :GetLatestVimScripts_dat pi_getscript.txt /*:GetLatestVimScripts_dat* @@ -38,6 +47,23 @@ :TCommentRight tComment.txt /*:TCommentRight* :Texplore pi_netrw.txt /*:Texplore* :UseVimball pi_vimball.txt /*:UseVimball* +:VCSAdd vcscommand.txt /*:VCSAdd* +:VCSAnnotate vcscommand.txt /*:VCSAnnotate* +:VCSBlame vcscommand.txt /*:VCSBlame* +:VCSCommit vcscommand.txt /*:VCSCommit* +:VCSDelete vcscommand.txt /*:VCSDelete* +:VCSDiff vcscommand.txt /*:VCSDiff* +:VCSGotoOriginal vcscommand.txt /*:VCSGotoOriginal* +:VCSInfo vcscommand.txt /*:VCSInfo* +:VCSLock vcscommand.txt /*:VCSLock* +:VCSLog vcscommand.txt /*:VCSLog* +:VCSRemove vcscommand.txt /*:VCSRemove* +:VCSRevert vcscommand.txt /*:VCSRevert* +:VCSReview vcscommand.txt /*:VCSReview* +:VCSStatus vcscommand.txt /*:VCSStatus* +:VCSUnlock vcscommand.txt /*:VCSUnlock* +:VCSUpdate vcscommand.txt /*:VCSUpdate* +:VCSVimDiff vcscommand.txt /*:VCSVimDiff* :Vexplore pi_netrw.txt /*:Vexplore* :VimballList pi_vimball.txt /*:VimballList* Align-copyright Align.txt /*Align-copyright* @@ -66,6 +92,25 @@ SRHiGrp SrchRplcHiGrp.txt /*SRHiGrp* SRSearch SrchRplcHiGrp.txt /*SRSearch* SrchRplcHiGrp.txt SrchRplcHiGrp.txt /*SrchRplcHiGrp.txt* TCommentDefineType() tComment.txt /*TCommentDefineType()* +VCSCommandCVSDiffOpt vcscommand.txt /*VCSCommandCVSDiffOpt* +VCSCommandCVSExec vcscommand.txt /*VCSCommandCVSExec* +VCSCommandCommitOnWrite vcscommand.txt /*VCSCommandCommitOnWrite* +VCSCommandDeleteOnHide vcscommand.txt /*VCSCommandDeleteOnHide* +VCSCommandDiffSplit vcscommand.txt /*VCSCommandDiffSplit* +VCSCommandDisableAll vcscommand.txt /*VCSCommandDisableAll* +VCSCommandDisableExtensionMappings vcscommand.txt /*VCSCommandDisableExtensionMappings* +VCSCommandDisableMappings vcscommand.txt /*VCSCommandDisableMappings* +VCSCommandEdit vcscommand.txt /*VCSCommandEdit* +VCSCommandEnableBufferSetup vcscommand.txt /*VCSCommandEnableBufferSetup* +VCSCommandMapPrefix vcscommand.txt /*VCSCommandMapPrefix* +VCSCommandMappings vcscommand.txt /*VCSCommandMappings* +VCSCommandResultBufferNameExtension vcscommand.txt /*VCSCommandResultBufferNameExtension* +VCSCommandResultBufferNameFunction vcscommand.txt /*VCSCommandResultBufferNameFunction* +VCSCommandSVKExec vcscommand.txt /*VCSCommandSVKExec* +VCSCommandSVNDiffExt vcscommand.txt /*VCSCommandSVNDiffExt* +VCSCommandSVNDiffOpt vcscommand.txt /*VCSCommandSVNDiffOpt* +VCSCommandSVNExec vcscommand.txt /*VCSCommandSVNExec* +VCSCommandSplit vcscommand.txt /*VCSCommandSplit* VimPdb.txt VimPdb.txt /*VimPdb.txt* Vimball-copyright pi_vimball.txt /*Vimball-copyright* [% matchit.txt /*[%* @@ -148,6 +193,10 @@ alignmap-tt Align.txt /*alignmap-tt* alignmap-t~ Align.txt /*alignmap-t~* alignmaps Align.txt /*alignmaps* alignusage Align.txt /*alignusage* +b:VCSCommandCommand vcscommand.txt /*b:VCSCommandCommand* +b:VCSCommandOriginalBuffer vcscommand.txt /*b:VCSCommandOriginalBuffer* +b:VCSCommandSourceFile vcscommand.txt /*b:VCSCommandSourceFile* +b:VCSCommandVCSType vcscommand.txt /*b:VCSCommandVCSType* b:match_col matchit.txt /*b:match_col* b:match_debug matchit.txt /*b:match_debug* b:match_ignorecase matchit.txt /*b:match_ignorecase* @@ -1401,6 +1450,7 @@ crvdoc-licGPL crefvimdoc.txt /*crvdoc-licGPL* crvdoc-licLGPL crefvimdoc.txt /*crvdoc-licLGPL* crvdoc-limbugs crefvimdoc.txt /*crvdoc-limbugs* crvdoc-usage crefvimdoc.txt /*crvdoc-usage* +cvscommand-changes vcscommand.txt /*cvscommand-changes* dav pi_netrw.txt /*dav* davs pi_netrw.txt /*davs* drv-dtArrayInit crefvim.txt /*drv-dtArrayInit* @@ -1741,6 +1791,29 @@ v_]% matchit.txt /*v_]%* v_a% matchit.txt /*v_a%* v_g% matchit.txt /*v_g%* vba pi_vimball.txt /*vba* +vcscommand vcscommand.txt /*vcscommand* +vcscommand-buffer-management vcscommand.txt /*vcscommand-buffer-management* +vcscommand-buffer-variables vcscommand.txt /*vcscommand-buffer-variables* +vcscommand-bugs vcscommand.txt /*vcscommand-bugs* +vcscommand-commands vcscommand.txt /*vcscommand-commands* +vcscommand-config vcscommand.txt /*vcscommand-config* +vcscommand-contents vcscommand.txt /*vcscommand-contents* +vcscommand-customize vcscommand.txt /*vcscommand-customize* +vcscommand-events vcscommand.txt /*vcscommand-events* +vcscommand-install vcscommand.txt /*vcscommand-install* +vcscommand-intro vcscommand.txt /*vcscommand-intro* +vcscommand-manual vcscommand.txt /*vcscommand-manual* +vcscommand-mappings vcscommand.txt /*vcscommand-mappings* +vcscommand-mappings-override vcscommand.txt /*vcscommand-mappings-override* +vcscommand-naming vcscommand.txt /*vcscommand-naming* +vcscommand-options vcscommand.txt /*vcscommand-options* +vcscommand-ssh vcscommand.txt /*vcscommand-ssh* +vcscommand-ssh-config vcscommand.txt /*vcscommand-ssh-config* +vcscommand-ssh-env vcscommand.txt /*vcscommand-ssh-env* +vcscommand-ssh-other vcscommand.txt /*vcscommand-ssh-other* +vcscommand-ssh-wrapper vcscommand.txt /*vcscommand-ssh-wrapper* +vcscommand-statusline vcscommand.txt /*vcscommand-statusline* +vcscommand.txt vcscommand.txt /*vcscommand.txt* vimball pi_vimball.txt /*vimball* vimball-contents pi_vimball.txt /*vimball-contents* vimball-extract pi_vimball.txt /*vimball-extract* diff --git a/vimfiles/plugin/svndiff.vim b/vimfiles/plugin/svndiff.vim index e32bb53..1b689ce 100644 --- a/vimfiles/plugin/svndiff.vim +++ b/vimfiles/plugin/svndiff.vim @@ -16,12 +16,15 @@ " " NOTE: This plugin is unix-only! " -" An small vim 7.0 plugin for showing svn diff information in a file while +" An small vim 7.0 plugin for showing RCS diff information in a file while " editing. This plugin runs a diff between the current buffer and the original -" subversion file, and shows coloured signs indicating where the buffer -" differs from the original file from the subversion repository. The original +" file from svn or git, and shows coloured signs indicating where the buffer +" differs from the original file from the repository. The original " text is not shown, only signs are used to indicate where changes were made. " +" The plugin can be used for files managed with subversion or GIT. The type of +" RCS will be detected when first issuing a svndiff command on the file. +" " The following symbols and syntax highlight groups are used for the signs: " " > DiffAdd: Newly added lines. (default=blue) @@ -34,9 +37,9 @@ " ----- " " The plugin defines one function: Svndiff(). This function figures out the -" difference between the current buffer and it's subversion original, and adds +" difference between the current buffer and it's svn/git original, and adds " the signs at the places where the buffer differs from the original file from -" subversion. You'll need to call this function after making changes to update +" svn or git. You'll need to call this function after making changes to update " the highlighting. " " The function takes one argument specifying an additional action to perform: @@ -116,19 +119,32 @@ " is now simply disabled for older vim versions to avoid " a lot of warnings when loading. " +" 4.0 2008-11-24 Added GIT support. The RCS type is now detected (svn/git) +" +" 4.1 2008-11-25 Added CVS support. +" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" if v:version < 700 finish endif +" Globals for this plugin let s:sign_base = 200000 " Base for our sign id's, hoping to avoid colisions let s:is_active = {} " dictionary with buffer names that have svndiff active +let s:rcs_type = {} " RCS type, will be autodetected to 'svn' or 'git' +let s:rcs_cmd = {} " Shell command to execute to get contents of clean file from RCS let s:diff_signs = {} " dict with list of ids of all signs, per file let s:diff_blocks = {} " dict with list of ids of first line of each diff block, per file let s:changedtick = {} " dict with changedticks of each buffer since last invocation +" Commands to execute to get current file contents in various rcs systems + +let s:rcs_cmd_svn = "svn cat " +let s:rcs_cmd_git = "git cat-file -p HEAD:" +let s:rcs_cmd_cvs = "cvs -q update -p " + " " Do the diff and update signs. " @@ -141,13 +157,35 @@ function s:Svndiff_update(...) return 0 end - " Check if this file is managed by subversion, exit otherwise + " Guess RCS type for this file - let info = system("LANG=C svn info " . fname) - if match(info, "Path") == -1 - echom "Svndiff: Warning, file " . fname . " is not managed by subversion, or error running svn." + if ! has_key(s:rcs_type, fname) + + let info = system("LANG=C svn info " . fname) + if match(info, "Path") != -1 + let s:rcs_type[fname] = "svn" + let s:rcs_cmd[fname] = s:rcs_cmd_svn + end + + let info = system("git st " . fname) + if v:shell_error == 0 + let s:rcs_type[fname] = "git" + let s:rcs_cmd[fname] = s:rcs_cmd_git + end + + let info = system("cvs st " . fname) + if v:shell_error == 0 + let s:rcs_type[fname] = "cvs" + let s:rcs_cmd[fname] = s:rcs_cmd_cvs + end + end + + " Could not detect RCS type, print message and exit + + if ! has_key(s:rcs_type, fname) + echom "Svndiff: Warning, file " . fname . " is not managed by subversion or git" unlet s:is_active[fname] - return 0 + return end " Check if the changedticks changed since the last invocation of this @@ -163,7 +201,7 @@ function s:Svndiff_update(...) " shell command calculating the diff in a friendly parsable format. let contents = join(getbufline("%", 1, "$"), "\n") - let diff = system("diff -U0 <(svn cat " . fname . ") <(cat;echo)", contents) + let diff = system("diff -U0 <(" . s:rcs_cmd[fname] . fname . ") <(cat;echo)", contents) " clear the old signs