[SCM] vim-scripts packaging branch, master, updated. v20091011-7-g153d936
James Vega
jamessan at debian.org
Tue Jan 26 22:23:44 UTC 2010
The following commit has been merged in the master branch:
commit d461d90cc9c1063540b694c23392cabdf69e6771
Author: James Vega <jamessan at debian.org>
Date: Tue Jan 26 17:10:31 2010 -0500
Update vcscommand to 1.99.35
Signed-off-by: James Vega <jamessan at debian.org>
diff --git a/debian/changelog b/debian/changelog
index abcfcc7..3a428c7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,7 @@ vim-scripts (20091012) UNRELEASED; urgency=low
- supertab: Updated to 1.0
- DoxygenToolkit: Update to 0.2.7
- Color Sampler Pack: Update to 8.03
+ - vcscommand: Update to 1.99.35
-- James Vega <jamessan at debian.org> Sun, 24 Jan 2010 17:10:16 -0500
diff --git a/debian/vim-scripts.status b/debian/vim-scripts.status
index 0336888..e954dbe 100644
--- a/debian/vim-scripts.status
+++ b/debian/vim-scripts.status
@@ -131,15 +131,15 @@ version: 1.150
script_name: plugin/vcscommand.vim
addon: vcscommand
-description: CVS/SVN integration (including vimdiff support)
+description: CVS/SVN/SVK/git/hg/bzr integration plugin
script_url: http://www.vim.org/scripts/script.php?script_id=90
author: Robert Hiestand
author_url: http://www.vim.org/account/profile.php?user_id=241
email: bob.hiestand at gmail.com
license: license[7], see below
-extras: doc/vcscommand.txt, plugin/vcs*.vim, syntax/CVSAnnotate.vim, syntax/gitAnnotate.vim, syntax/SVNAnnotate.vim, syntax/SVKAnnotate.vim, syntax/vcscommit.vim
+extras: doc/vcscommand.txt, plugin/vcs*.vim, syntax/*Annotate.vim, syntax/vcscommit.vim
disabledby: let VCSCommandDisableAll = 1
-version: 1.99.31
+version: 1.99.35
script_name: plugin/utl.vim
addon: utl
diff --git a/doc/vcscommand.txt b/doc/vcscommand.txt
index cf6bd97..34fb5cc 100644
--- a/doc/vcscommand.txt
+++ b/doc/vcscommand.txt
@@ -81,7 +81,7 @@ output appears in a new window.
Many of the commands accept revisions as arguments. By default, most operate
on the most recent revision on the current branch if no revision is specified.
-Each vcscommand is mapped to a key sequence starting with the <Leader>
+Each vcscommand is mapped to a key sequence starting with the |<Leader>|
keystroke. The default mappings may be overridden by supplying different
mappings before the plugin is loaded, such as in the vimrc, in the standard
fashion for plugin mappings. For examples, please see
@@ -172,9 +172,10 @@ log message. The commit can be abandoned if the log message buffer is deleted
or wiped before being written.
Alternatively, the mapping that is used to invoke :VCSCommit (by default
-<Leader>cc) can be used in the log message buffer to immediately commit. This
-is useful if the |VCSCommandCommitOnWrite| variable is set to 0 to disable the
-normal commit-on-write behavior.
+|<Leader>|cc, please see |vcscommand-mappings|) can be used in the log message
+buffer in Normal mode to immediately commit. This is useful if the
+|VCSCommandCommitOnWrite| variable is set to 0 to disable the normal
+commit-on-write behavior.
:VCSDelete *:VCSDelete*
@@ -329,33 +330,33 @@ This command performs "cvs watchers" on the current file.
By default, a mapping is defined for each command. These mappings execute the
default (no-argument) form of each command.
-<Leader>ca VCSAdd
-<Leader>cn VCSAnnotate
-<Leader>cN VCSAnnotate!
-<Leader>cc VCSCommit
-<Leader>cD VCSDelete
-<Leader>cd VCSDiff
-<Leader>cg VCSGotoOriginal
-<Leader>cG VCSGotoOriginal!
-<Leader>ci VCSInfo
-<Leader>cl VCSLog
-<Leader>cL VCSLock
-<Leader>cr VCSReview
-<Leader>cs VCSStatus
-<Leader>cu VCSUpdate
-<Leader>cU VCSUnlock
-<Leader>cv VCSVimDiff
+|<Leader>|ca VCSAdd
+|<Leader>|cn VCSAnnotate
+|<Leader>|cN VCSAnnotate!
+|<Leader>|cc VCSCommit
+|<Leader>|cD VCSDelete
+|<Leader>|cd VCSDiff
+|<Leader>|cg VCSGotoOriginal
+|<Leader>|cG VCSGotoOriginal!
+|<Leader>|ci VCSInfo
+|<Leader>|cl VCSLog
+|<Leader>|cL VCSLock
+|<Leader>|cr VCSReview
+|<Leader>|cs VCSStatus
+|<Leader>|cu VCSUpdate
+|<Leader>|cU VCSUnlock
+|<Leader>|cv VCSVimDiff
Only for CVS buffers:
-<Leader>ce CVSEdit
-<Leader>cE CVSEditors
-<Leader>ct CVSUnedit
-<Leader>cwv CVSWatchers
-<Leader>cwa CVSWatchAdd
-<Leader>cwn CVSWatchOn
-<Leader>cwf CVSWatchOff
-<Leader>cwf CVSWatchRemove
+|<Leader>|ce CVSEdit
+|<Leader>|cE CVSEditors
+|<Leader>|ct CVSUnedit
+|<Leader>|cwv CVSWatchers
+|<Leader>|cwa CVSWatchAdd
+|<Leader>|cwn CVSWatchOn
+|<Leader>|cwf CVSWatchOff
+|<Leader>|cwf CVSWatchRemove
*vcscommand-mappings-override*
diff --git a/html/index.html b/html/index.html
index 67a6ce1..31e4a06 100644
--- a/html/index.html
+++ b/html/index.html
@@ -50,7 +50,7 @@
<li><a href="syntax_mkd.vim.html">syntax/mkd.vim.html</a></li>
</ul>
<p>
- Page generated on Tue, 26 Jan 2010 17:01:16 -0500
+ Page generated on Tue, 26 Jan 2010 17:05:50 -0500
.
</p>
</body>
diff --git a/html/plugin_vcscommand.vim.html b/html/plugin_vcscommand.vim.html
index a6a27d5..ad2a8ca 100644
--- a/html/plugin_vcscommand.vim.html
+++ b/html/plugin_vcscommand.vim.html
@@ -3,7 +3,7 @@
<head>
<link rel="Stylesheet" type="text/css" href="/css/style.css" >
- <title>vcscommand.vim - CVS/SVN/SVK/git integration plugin : vim online</title>
+ <title>vcscommand.vim - CVS/SVN/SVK/git/hg/bzr integration plugin : vim online</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="KEYWORDS" content="Vim, Vi IMproved, text editor, home, documentation, tips, scripts, news">
<link rel="shortcut icon" type="image/x-icon" href="/images/vim_shortcut.ico">
@@ -156,7 +156,7 @@
<tr>
<td valign="top">
-<span class="txth1">vcscommand.vim : CVS/SVN/SVK/git integration plugin</span>
+<span class="txth1">vcscommand.vim : CVS/SVN/SVK/git/hg/bzr integration plugin</span>
<br>
<br>
@@ -166,8 +166,8 @@
<tr>
<td class="lightbg"><b> script karma </b></td>
<td>
- Rating <b>2098/697</b>,
- Downloaded by 30334 </td>
+ Rating <b>2335/783</b>,
+ Downloaded by 33038 </td>
</tr>
</table>
<p>
@@ -217,6 +217,38 @@ Click on the package to download.
<th valign="top">release notes</th>
</tr>
<tr>
+ <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=12191">vcscommand-1.99.35.zip</a></td>
+ <td class="rowodd" valign="top" nowrap><b>1.99.35</b></td>
+ <td class="rowodd" valign="top" nowrap><i>2010-01-26</i></td>
+ <td class="rowodd" valign="top" nowrap>7.0</td>
+ <td class="rowodd" valign="top"><i><a href="/account/profile.php?user_id=241">Bob Hiestand</a></i></td>
+ <td class="rowodd" valign="top" width="2000">Fixed hang in MacVim on Snow Leopard (thanks to Adam Lickel).</td>
+</tr>
+<tr>
+ <td class="roweven" valign="top" nowrap><a href="download_script.php?src_id=12073">vcscommand-1.99.34.zip</a></td>
+ <td class="roweven" valign="top" nowrap><b>1.99.34</b></td>
+ <td class="roweven" valign="top" nowrap><i>2010-01-11</i></td>
+ <td class="roweven" valign="top" nowrap>7.0</td>
+ <td class="roweven" valign="top"><i><a href="/account/profile.php?user_id=241">Bob Hiestand</a></i></td>
+ <td class="roweven" valign="top" width="2000">vcshg: Added annotate syntax.</td>
+</tr>
+<tr>
+ <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=12031">vcscommand.zip</a></td>
+ <td class="rowodd" valign="top" nowrap><b>1.99.33</b></td>
+ <td class="rowodd" valign="top" nowrap><i>2010-01-08</i></td>
+ <td class="rowodd" valign="top" nowrap>7.0</td>
+ <td class="rowodd" valign="top"><i><a href="/account/profile.php?user_id=241">Bob Hiestand</a></i></td>
+ <td class="rowodd" valign="top" width="2000">HG improvements:
<br>
<br>Fixed variable assignment bug in GetBufferInfo.
<br>Add username to blame output.
<br>Added split annotate view.
<br></td>
+</tr>
+<tr>
+ <td class="roweven" valign="top" nowrap><a href="download_script.php?src_id=12026">vcscommand.zip</a></td>
+ <td class="roweven" valign="top" nowrap><b>1.99.32</b></td>
+ <td class="roweven" valign="top" nowrap><i>2010-01-07</i></td>
+ <td class="roweven" valign="top" nowrap>7.0</td>
+ <td class="roweven" valign="top"><i><a href="/account/profile.php?user_id=241">Bob Hiestand</a></i></td>
+ <td class="roweven" valign="top" width="2000">* Resolve ambiguous file/branch names.
<br>* Work correctly with blanks in 'VCSCommandXXXExec' variable.
<br>
<br>vcsbzr: Add VCSCommandDisableAll kill switch.
<br>vcsbzr: use annotate split mode.
<br>vcscvs: Made GetRevision() script-local.
<br>vcshg: Identify hg version control when not in the root of a repository.
<br>gitAnnotate.vim: match original commits in blame
<br></td>
+</tr>
+<tr>
<td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=11049">vcscommand.zip</a></td>
<td class="rowodd" valign="top" nowrap><b>1.99.31</b></td>
<td class="rowodd" valign="top" nowrap><i>2009-07-21</i></td>
diff --git a/plugin/vcsbzr.vim b/plugin/vcsbzr.vim
index 60dc455..bbbca38 100644
--- a/plugin/vcsbzr.vim
+++ b/plugin/vcsbzr.vim
@@ -35,14 +35,15 @@
" Section: Plugin header {{{1
+if exists('VCSCommandDisableAll')
+ finish
+endif
+
if v:version < 700
echohl WarningMsg|echomsg 'VCSCommand requires at least VIM 7.0'|echohl None
finish
endif
-let s:save_cpo=&cpo
-set cpo&vim
-
runtime plugin/vcscommand.vim
if !executable(VCSCommandGetOption('VCSCommandBZRExec', 'bzr'))
@@ -50,18 +51,28 @@ if !executable(VCSCommandGetOption('VCSCommandBZRExec', 'bzr'))
finish
endif
+let s:save_cpo=&cpo
+set cpo&vim
+
" Section: Variable initialization {{{1
let s:bzrFunctions = {}
" Section: Utility functions {{{1
+" Function: s:Executable() {{{2
+" Returns the executable used to invoke bzr suitable for use in a shell
+" command.
+function! s:Executable()
+ return shellescape(VCSCommandGetOption('VCSCommandBZRExec', 'bzr'))
+endfunction
+
" Function: s:DoCommand(cmd, cmdName, statusText) {{{2
" Wrapper to VCSCommandDoCommand to add the name of the BZR executable to the
" command argument.
function! s:DoCommand(cmd, cmdName, statusText, options)
if VCSCommandGetVCSType(expand('%')) == 'BZR'
- let fullCmd = VCSCommandGetOption('VCSCommandBZRExec', 'bzr') . ' ' . a:cmd
+ let fullCmd = s:Executable() . ' ' . a:cmd
return VCSCommandDoCommand(fullCmd, a:cmdName, a:statusText, a:options)
else
throw 'BZR VCSCommand plugin called on non-BZR item.'
@@ -73,7 +84,7 @@ endfunction
" Function: s:bzrFunctions.Identify(buffer) {{{2
function! s:bzrFunctions.Identify(buffer)
let fileName = resolve(bufname(a:buffer))
- let statusText = system(VCSCommandGetOption('VCSCommandBZRExec', 'bzr') . ' info "' . fileName . '"')
+ let statusText = s:VCSCommandUtility.system(s:Executable() . ' info -- "' . fileName . '"')
if(v:shell_error)
return 0
else
@@ -158,8 +169,8 @@ endfunction
function! s:bzrFunctions.GetBufferInfo()
let originalBuffer = VCSCommandGetOriginalBuffer(bufnr('%'))
let fileName = resolve(bufname(originalBuffer))
- let statusText = system(VCSCommandGetOption('VCSCommandBZRExec', 'bzr') . ' status -S "' . fileName . '"')
- let revision = system(VCSCommandGetOption('VCSCommandBZRExec', 'bzr') . ' revno "' . fileName . '"')
+ let statusText = s:VCSCommandUtility.system(s:Executable() . ' status -S -- "' . fileName . '"')
+ let revision = s:VCSCommandUtility.system(s:Executable() . ' revno -- "' . fileName . '"')
if(v:shell_error)
return []
endif
@@ -248,7 +259,10 @@ function! s:bzrFunctions.Update(argList)
return s:DoCommand('update', 'update', '', {})
endfunction
+" Annotate setting {{{2
+let s:bzrFunctions.AnnotateSplitRegex = '^[^|]\+ | '
+
" Section: Plugin Registration {{{1
-call VCSCommandRegisterModule('BZR', expand('<sfile>'), s:bzrFunctions, [])
+let s:VCSCommandUtility = VCSCommandRegisterModule('BZR', expand('<sfile>'), s:bzrFunctions, [])
let &cpo = s:save_cpo
diff --git a/plugin/vcscommand.vim b/plugin/vcscommand.vim
index 2070e1a..88bc654 100644
--- a/plugin/vcscommand.vim
+++ b/plugin/vcscommand.vim
@@ -3,7 +3,6 @@
" Vim plugin to assist in working with files under control of various Version
" Control Systems, such as CVS, SVN, SVK, and git.
"
-" Version: 1.99.31
" Maintainer: Bob Hiestand <bob.hiestand at gmail.com>
" License:
" Copyright (c) 2008 Bob Hiestand
@@ -33,12 +32,11 @@
" directory and all subdirectories associated with the current buffer). The
" output of the commands is captured in a new scratch window.
"
-" This plugin needs additional extension plugins, each specific to a source
-" control system, to function. Those plugins should be placed in a
-" subdirectory of the standard plugin directory named 'vcscommand'. Several
-" options include the name of the version control system in the option name.
-" Such options use the placeholder text '{VCSType}', which would be replaced
-" in actual usage with 'CVS' or 'SVN', for instance.
+" This plugin needs additional extension plugins, each specific to a source
+" control system, to function. Several options include the name of the
+" version control system in the option name. Such options use the placeholder
+" text '{VCSType}', which would be replaced in actual usage with 'CVS' or
+" 'SVN', for instance.
"
" Command documentation {{{2
"
@@ -93,7 +91,7 @@
" VCS scratch buffers associated with the original file.
"
" VCSInfo Displays extended information about the current file in a
-" new scratch buffer.
+" new scratch buffer.
"
" VCSLock Locks the current file in order to prevent other users from
" concurrently modifying it. The exact semantics of this
@@ -273,7 +271,7 @@
" mapping to quit a VCS scratch buffer:
"
" augroup VCSCommand
-" au VCSCommand User VCSBufferCreated silent! nmap <unique> <buffer> q :bwipeout<cr>
+" au VCSCommand User VCSBufferCreated silent! nmap <unique> <buffer> q :bwipeout<cr>
" augroup END
"
" The following hooks are available:
@@ -336,6 +334,9 @@ let g:VCSCOMMAND_IDENTIFY_INEXACT = -1
" Section: Script variable initialization {{{1
+" Hidden functions for use by extensions
+let s:VCSCommandUtility = {}
+
" plugin-specific information: {vcs -> [script, {command -> function}, {key -> mapping}]}
let s:plugins = {}
@@ -351,7 +352,7 @@ unlet! s:vimDiffRestoreCmd
" original buffer currently reflected in vimdiff windows
unlet! s:vimDiffSourceBuffer
-"
+"
unlet! s:vimDiffScratchList
" Section: Utility functions {{{1
@@ -364,6 +365,23 @@ function! s:ReportError(error)
echohl WarningMsg|echomsg 'VCSCommand: ' . a:error|echohl None
endfunction
+" Function s:VCSCommandUtility.system(...) {{{2
+" Replacement for system() function. This version protects the quoting in the
+" command line on Windows systems.
+
+function! s:VCSCommandUtility.system(...)
+ if (has("win32") || has("win64")) && &sxq !~ '"'
+ let save_sxq = &sxq
+ set sxq=\"
+ endif
+ try
+ return call('system', a:000)
+ finally
+ if exists("save_sxq")
+ let &sxq = save_sxq
+ endif
+ endtry
+endfunction
" Function: s:CreateMapping(shortcut, expansion, display) {{{2
" Creates the given mapping by prepending the contents of
@@ -576,7 +594,7 @@ endfunction
function! s:MarkOrigBufferForSetup(buffer)
checktime
- if a:buffer > 0
+ if a:buffer > 0
let origBuffer = VCSCommandGetOriginalBuffer(a:buffer)
" This should never not work, but I'm paranoid
if origBuffer != a:buffer
@@ -665,7 +683,7 @@ function! s:VimDiffRestore(vimDiffBuff)
endif
unlet s:vimDiffRestoreCmd
- endif
+ endif
" All buffers are gone.
unlet s:vimDiffSourceBuffer
unlet s:vimDiffScratchList
@@ -767,7 +785,7 @@ endfunction
function! s:VCSFinishCommitWithBuffer()
setlocal nomodified
- let currentBuffer = bufnr('%')
+ let currentBuffer = bufnr('%')
let logMessageList = getbufline('%', 1, '$')
call filter(logMessageList, 'v:val !~ ''^\s*VCS:''')
let resultBuffer = s:VCSFinishCommit(logMessageList, b:VCSCommandOriginalBuffer)
@@ -905,7 +923,7 @@ function! s:VCSVimDiff(...)
wincmd W
execute 'buffer' originalBuffer
" Store info for later original buffer restore
- let s:vimDiffRestoreCmd =
+ let s:vimDiffRestoreCmd =
\ 'call setbufvar('.originalBuffer.', ''&diff'', '.getbufvar(originalBuffer, '&diff').')'
\ . '|call setbufvar('.originalBuffer.', ''&foldcolumn'', '.getbufvar(originalBuffer, '&foldcolumn').')'
\ . '|call setbufvar('.originalBuffer.', ''&foldenable'', '.getbufvar(originalBuffer, '&foldenable').')'
@@ -1047,6 +1065,7 @@ function! VCSCommandRegisterModule(name, path, commandMap, mappingMap)
call s:CreateMapping(shortcut, expansion, a:name . " extension mapping " . shortcut)
endfor
endif
+ return s:VCSCommandUtility
endfunction
" Function: VCSCommandDoCommand(cmd, cmdName, statusText, [options]) {{{2
@@ -1068,7 +1087,7 @@ function! VCSCommandDoCommand(cmd, cmdName, statusText, options)
endif
let originalBuffer = VCSCommandGetOriginalBuffer(bufnr('%'))
- if originalBuffer == -1
+ if originalBuffer == -1
throw 'Original buffer no longer exists, aborting.'
endif
@@ -1086,7 +1105,7 @@ function! VCSCommandDoCommand(cmd, cmdName, statusText, options)
if match(a:cmd, '<VCSCOMMANDFILE>') > 0
let fullCmd = substitute(a:cmd, '<VCSCOMMANDFILE>', fileName, 'g')
else
- let fullCmd = a:cmd . ' "' . fileName . '"'
+ let fullCmd = a:cmd . ' -- "' . fileName . '"'
endif
" Change to the directory of the current buffer. This is done for CVS, but
@@ -1094,7 +1113,7 @@ function! VCSCommandDoCommand(cmd, cmdName, statusText, options)
let oldCwd = VCSCommandChangeToCurrentFileDir(path)
try
- let output = system(fullCmd)
+ let output = s:VCSCommandUtility.system(fullCmd)
finally
call VCSCommandChdir(oldCwd)
endtry
@@ -1323,7 +1342,7 @@ function! s:CloseAllResultBuffers()
let buffnr = 1
let buffmaxnr = bufnr('$')
while buffnr <= buffmaxnr
- if getbufvar(buffnr, 'VCSCommandOriginalBuffer') != ""
+ if getbufvar(buffnr, 'VCSCommandOriginalBuffer') != ""
execute 'bw' buffnr
endif
let buffnr = buffnr + 1
diff --git a/plugin/vcscvs.vim b/plugin/vcscvs.vim
index a548276..2e9c102 100644
--- a/plugin/vcscvs.vim
+++ b/plugin/vcscvs.vim
@@ -32,23 +32,23 @@
" The following commands only apply to files under CVS source control.
"
" CVSEdit Performs "cvs edit" on the current file.
-"
+"
" CVSEditors Performs "cvs editors" on the current file.
-"
+"
" CVSUnedit Performs "cvs unedit" on the current file.
-"
+"
" CVSWatch Takes an argument which must be one of [on|off|add|remove].
" Performs "cvs watch" with the given argument on the current
" file.
-"
+"
" CVSWatchers Performs "cvs watchers" on the current file.
-"
+"
" CVSWatchAdd Alias for "CVSWatch add"
-"
+"
" CVSWatchOn Alias for "CVSWatch on"
-"
+"
" CVSWatchOff Alias for "CVSWatch off"
-"
+"
" CVSWatchRemove Alias for "CVSWatch remove"
"
" Mapping documentation: {{{2
@@ -106,12 +106,19 @@ let s:cvsFunctions = {}
" Section: Utility functions {{{1
+" Function: s:Executable() {{{2
+" Returns the executable used to invoke cvs suitable for use in a shell
+" command.
+function! s:Executable()
+ return shellescape(VCSCommandGetOption('VCSCommandCVSExec', 'cvs'))
+endfunction
+
" Function: s:DoCommand(cmd, cmdName, statusText, options) {{{2
" Wrapper to VCSCommandDoCommand to add the name of the CVS executable to the
" command argument.
function! s:DoCommand(cmd, cmdName, statusText, options)
if VCSCommandGetVCSType(expand('%')) == 'CVS'
- let fullCmd = VCSCommandGetOption('VCSCommandCVSExec', 'cvs') . ' ' . a:cmd
+ let fullCmd = s:Executable() . ' ' . a:cmd
let ret = VCSCommandDoCommand(fullCmd, a:cmdName, a:statusText, a:options)
if ret > 0
@@ -128,11 +135,11 @@ function! s:DoCommand(cmd, cmdName, statusText, options)
endif
endfunction
-" Function: GetRevision() {{{2
+" Function: s:GetRevision() {{{2
" Function for retrieving the current buffer's revision number.
" Returns: Revision number or an empty string if an error occurs.
-function! GetRevision()
+function! s:GetRevision()
if !exists('b:VCSCommandBufferInfo')
let b:VCSCommandBufferInfo = s:cvsFunctions.GetBufferInfo()
endif
@@ -197,7 +204,7 @@ function! s:cvsFunctions.Annotate(argList)
" CVS defaults to pulling HEAD, regardless of current branch.
" Therefore, always pass desired revision.
let caption = ''
- let options = ['-r' . GetRevision()]
+ let options = ['-r' . s:GetRevision()]
endif
elseif len(a:argList) == 1 && a:argList[0] !~ '^-'
let caption = a:argList[0]
@@ -294,7 +301,7 @@ function! s:cvsFunctions.GetBufferInfo()
endif
let oldCwd = VCSCommandChangeToCurrentFileDir(fileName)
try
- let statusText=system(VCSCommandGetOption('VCSCommandCVSExec', 'cvs') . ' status "' . realFileName . '"')
+ let statusText=s:VCSCommandUtility.system(s:Executable() . ' status -- "' . realFileName . '"')
if(v:shell_error)
return []
endif
@@ -302,7 +309,7 @@ function! s:cvsFunctions.GetBufferInfo()
" We can still be in a CVS-controlled directory without this being a CVS
" file
- if match(revision, '^New file!$') >= 0
+ if match(revision, '^New file!$') >= 0
let revision='New'
elseif match(revision, '^\d\+\.\d\+\%(\.\d\+\.\d\+\)*$') <0
return ['Unknown']
@@ -448,6 +455,6 @@ amenu <silent> &Plugin.VCS.CVS.WatchOff <Plug>CVSWatchOff
amenu <silent> &Plugin.VCS.CVS.WatchRemove <Plug>CVSWatchRemove
" Section: Plugin Registration {{{1
-call VCSCommandRegisterModule('CVS', expand('<sfile>'), s:cvsFunctions, s:cvsExtensionMappings)
+let s:VCSCommandUtility = VCSCommandRegisterModule('CVS', expand('<sfile>'), s:cvsFunctions, s:cvsExtensionMappings)
let &cpo = s:save_cpo
diff --git a/plugin/vcsgit.vim b/plugin/vcsgit.vim
index d2eb50f..255e9ab 100644
--- a/plugin/vcsgit.vim
+++ b/plugin/vcsgit.vim
@@ -65,12 +65,19 @@ let s:gitFunctions = {}
" Section: Utility functions {{{1
+" Function: s:Executable() {{{2
+" Returns the executable used to invoke git suitable for use in a shell
+" command.
+function! s:Executable()
+ return shellescape(VCSCommandGetOption('VCSCommandGitExec', 'git'))
+endfunction
+
" Function: s:DoCommand(cmd, cmdName, statusText, options) {{{2
" Wrapper to VCSCommandDoCommand to add the name of the git executable to the
" command argument.
function! s:DoCommand(cmd, cmdName, statusText, options)
if VCSCommandGetVCSType(expand('%')) == 'git'
- let fullCmd = VCSCommandGetOption('VCSCommandGitExec', 'git',) . ' ' . a:cmd
+ let fullCmd = s:Executable() . ' ' . a:cmd
return VCSCommandDoCommand(fullCmd, a:cmdName, a:statusText, a:options)
else
throw 'git VCSCommand plugin called on non-git item.'
@@ -85,7 +92,7 @@ endfunction
function! s:gitFunctions.Identify(buffer)
let oldCwd = VCSCommandChangeToCurrentFileDir(resolve(bufname(a:buffer)))
try
- call system(VCSCommandGetOption('VCSCommandGitExec', 'git') . ' rev-parse --is-inside-work-tree')
+ call s:VCSCommandUtility.system(s:Executable() . ' rev-parse --is-inside-work-tree')
if(v:shell_error)
return 0
else
@@ -116,7 +123,7 @@ function! s:gitFunctions.Annotate(argList)
let options = join(a:argList, ' ')
endif
- let resultBuffer = s:DoCommand('blame ' . options . ' -- ', 'annotate', options, {})
+ let resultBuffer = s:DoCommand('blame ' . options, 'annotate', options, {})
if resultBuffer > 0
normal 1G
set filetype=gitAnnotate
@@ -177,7 +184,7 @@ endfunction
function! s:gitFunctions.GetBufferInfo()
let oldCwd = VCSCommandChangeToCurrentFileDir(resolve(bufname('%')))
try
- let branch = substitute(system(VCSCommandGetOption('VCSCommandGitExec', 'git') . ' symbolic-ref -q HEAD'), '\n$', '', '')
+ let branch = substitute(s:VCSCommandUtility.system(s:Executable() . ' symbolic-ref -q HEAD'), '\n$', '', '')
if v:shell_error
let branch = 'DETACHED'
else
@@ -190,7 +197,7 @@ function! s:gitFunctions.GetBufferInfo()
if method != ''
let method = ' --' . method
endif
- let tag = substitute(system(VCSCommandGetOption('VCSCommandGitExec', 'git') . ' describe' . method), '\n$', '', '')
+ let tag = substitute(s:VCSCommandUtility.system(s:Executable() . ' describe' . method), '\n$', '', '')
if !v:shell_error
call add(info, tag)
break
@@ -227,7 +234,7 @@ function! s:gitFunctions.Review(argList)
let oldCwd = VCSCommandChangeToCurrentFileDir(resolve(bufname(VCSCommandGetOriginalBuffer('%'))))
try
- let prefix = system(VCSCommandGetOption('VCSCommandGitExec', 'git') . ' rev-parse --show-prefix')
+ let prefix = s:VCSCommandUtility.system(s:Executable() . ' rev-parse --show-prefix')
finally
call VCSCommandChdir(oldCwd)
endtry
@@ -255,6 +262,6 @@ endfunction
let s:gitFunctions.AnnotateSplitRegex = ') '
" Section: Plugin Registration {{{1
-call VCSCommandRegisterModule('git', expand('<sfile>'), s:gitFunctions, [])
+let s:VCSCommandUtility = VCSCommandRegisterModule('git', expand('<sfile>'), s:gitFunctions, [])
let &cpo = s:save_cpo
diff --git a/plugin/vcshg.vim b/plugin/vcshg.vim
index deff5cd..a053f5e 100644
--- a/plugin/vcshg.vim
+++ b/plugin/vcshg.vim
@@ -67,12 +67,19 @@ let s:hgFunctions = {}
" Section: Utility functions {{{1
+" Function: s:Executable() {{{2
+" Returns the executable used to invoke hg suitable for use in a shell
+" command.
+function! s:Executable()
+ return shellescape(VCSCommandGetOption('VCSCommandHGExec', 'hg'))
+endfunction
+
" Function: s:DoCommand(cmd, cmdName, statusText, options) {{{2
" Wrapper to VCSCommandDoCommand to add the name of the HG executable to the
" command argument.
function! s:DoCommand(cmd, cmdName, statusText, options)
if VCSCommandGetVCSType(expand('%')) == 'HG'
- let fullCmd = VCSCommandGetOption('VCSCommandHGExec', 'hg') . ' ' . a:cmd
+ let fullCmd = s:Executable() . ' ' . a:cmd
return VCSCommandDoCommand(fullCmd, a:cmdName, a:statusText, a:options)
else
throw 'HG VCSCommand plugin called on non-HG item.'
@@ -83,12 +90,17 @@ endfunction
" Function: s:hgFunctions.Identify(buffer) {{{2
function! s:hgFunctions.Identify(buffer)
- call system(VCSCommandGetOption('VCSCommandHGExec', 'hg') . ' root')
- if(v:shell_error)
- return 0
- else
- return g:VCSCOMMAND_IDENTIFY_INEXACT
- endif
+ let oldCwd = VCSCommandChangeToCurrentFileDir(resolve(bufname(a:buffer)))
+ try
+ call s:VCSCommandUtility.system(s:Executable() . ' root')
+ if(v:shell_error)
+ return 0
+ else
+ return g:VCSCOMMAND_IDENTIFY_INEXACT
+ endif
+ finally
+ call VCSCommandChdir(oldCwd)
+ endtry
endfunction
" Function: s:hgFunctions.Add() {{{2
@@ -105,11 +117,11 @@ function! s:hgFunctions.Annotate(argList)
let options = ' -r' . caption
else
let caption = ''
- let options = ''
+ let options = ' -un'
endif
elseif len(a:argList) == 1 && a:argList[0] !~ '^-'
let caption = a:argList[0]
- let options = ' -r' . caption
+ let options = ' -un -r' . caption
else
let caption = join(a:argList, ' ')
let options = ' ' . caption
@@ -188,7 +200,7 @@ endfunction
function! s:hgFunctions.GetBufferInfo()
let originalBuffer = VCSCommandGetOriginalBuffer(bufnr('%'))
let fileName = bufname(originalBuffer)
- let statusText = system(VCSCommandGetOption('VCSCommandHGExec', 'hg') . ' status "' . fileName . '"')
+ let statusText = s:VCSCommandUtility.system(s:Executable() . ' status -- "' . fileName . '"')
if(v:shell_error)
return []
endif
@@ -198,11 +210,11 @@ function! s:hgFunctions.GetBufferInfo()
return ['Unknown']
endif
- let parentsText = system(VCSCommandGetOption('VCSCommandHGExec', 'hg') . ' parents "' . fileName . '"')
- let [revision] = matchlist(parentsText, '^changeset:\s\+\(\S\+\)\n')[1]
+ let parentsText = s:VCSCommandUtility.system(s:Executable() . ' parents -- "' . fileName . '"')
+ let revision = matchlist(parentsText, '^changeset:\s\+\(\S\+\)\n')[1]
- let logText = system(VCSCommandGetOption('VCSCommandHGExec', 'hg') . ' log "' . fileName . '"')
- let [repository] = matchlist(logText, '^changeset:\s\+\(\S\+\)\n')[1]
+ let logText = s:VCSCommandUtility.system(s:Executable() . ' log -- "' . fileName . '"')
+ let repository = matchlist(logText, '^changeset:\s\+\(\S\+\)\n')[1]
if revision == ''
" Error
@@ -269,7 +281,10 @@ function! s:hgFunctions.Update(argList)
return s:DoCommand('update', 'update', '', {})
endfunction
+" Annotate setting {{{2
+let s:hgFunctions.AnnotateSplitRegex = '\d\+: '
+
" Section: Plugin Registration {{{1
-call VCSCommandRegisterModule('HG', expand('<sfile>'), s:hgFunctions, [])
+let s:VCSCommandUtility = VCSCommandRegisterModule('HG', expand('<sfile>'), s:hgFunctions, [])
let &cpo = s:save_cpo
diff --git a/plugin/vcssvk.vim b/plugin/vcssvk.vim
index f79f578..c1142d7 100644
--- a/plugin/vcssvk.vim
+++ b/plugin/vcssvk.vim
@@ -60,12 +60,19 @@ let s:svkFunctions = {}
" Section: Utility functions {{{1
+" Function: s:Executable() {{{2
+" Returns the executable used to invoke SVK suitable for use in a shell
+" command.
+function! s:Executable()
+ return shellescape(VCSCommandGetOption('VCSCommandSVKExec', 'svk'))
+endfunction
+
" Function: s:DoCommand(cmd, cmdName, statusText, options) {{{2
" Wrapper to VCSCommandDoCommand to add the name of the SVK executable to the
" command argument.
function! s:DoCommand(cmd, cmdName, statusText, options)
if VCSCommandGetVCSType(expand('%')) == 'SVK'
- let fullCmd = VCSCommandGetOption('VCSCommandSVKExec', 'svk') . ' ' . a:cmd
+ let fullCmd = s:Executable() . ' ' . a:cmd
return VCSCommandDoCommand(fullCmd, a:cmdName, a:statusText, a:options)
else
throw 'SVK VCSCommand plugin called on non-SVK item.'
@@ -82,7 +89,7 @@ function! s:svkFunctions.Identify(buffer)
else
let directoryName = fnamemodify(fileName, ':p:h')
endif
- let statusText = system(VCSCommandGetOption('VCSCommandSVKExec', 'svk') . ' info "' . directoryName . '"')
+ let statusText = s:VCSCommandUtility.system(s:Executable() . ' info -- "' . directoryName . '"', "no")
if(v:shell_error)
return 0
else
@@ -138,7 +145,7 @@ endfunction
" Function: s:svkFunctions.Diff(argList) {{{2
function! s:svkFunctions.Diff(argList)
if len(a:argList) == 0
- let revOptions = []
+ let revOptions = []
let caption = ''
elseif len(a:argList) <= 2 && match(a:argList, '^-') == -1
let revOptions = ['-r' . join(a:argList, ':')]
@@ -167,7 +174,7 @@ endfunction
function! s:svkFunctions.GetBufferInfo()
let originalBuffer = VCSCommandGetOriginalBuffer(bufnr('%'))
let fileName = resolve(bufname(originalBuffer))
- let statusText = system(VCSCommandGetOption('VCSCommandSVKExec', 'svk') . ' status -v "' . fileName . '"')
+ let statusText = s:VCSCommandUtility.system(s:Executable() . ' status -v -- "' . fileName . '"')
if(v:shell_error)
return []
endif
@@ -257,6 +264,6 @@ function! s:svkFunctions.Update(argList)
endfunction
" Section: Plugin Registration {{{1
-call VCSCommandRegisterModule('SVK', expand('<sfile>'), s:svkFunctions, [])
+let s:VCSCommandUtility = VCSCommandRegisterModule('SVK', expand('<sfile>'), s:svkFunctions, [])
let &cpo = s:save_cpo
diff --git a/plugin/vcssvn.vim b/plugin/vcssvn.vim
index 90d2158..da738ee 100644
--- a/plugin/vcssvn.vim
+++ b/plugin/vcssvn.vim
@@ -67,12 +67,19 @@ let s:svnFunctions = {}
" Section: Utility functions {{{1
+" Function: s:Executable() {{{2
+" Returns the executable used to invoke git suitable for use in a shell
+" command.
+function! s:Executable()
+ return shellescape(VCSCommandGetOption('VCSCommandSVNExec', 'svn'))
+endfunction
+
" Function: s:DoCommand(cmd, cmdName, statusText, options) {{{2
" Wrapper to VCSCommandDoCommand to add the name of the SVN executable to the
" command argument.
function! s:DoCommand(cmd, cmdName, statusText, options)
if VCSCommandGetVCSType(expand('%')) == 'SVN'
- let fullCmd = VCSCommandGetOption('VCSCommandSVNExec', 'svn') . ' ' . a:cmd
+ let fullCmd = s:Executable() . ' ' . a:cmd
return VCSCommandDoCommand(fullCmd, a:cmdName, a:statusText, a:options)
else
throw 'SVN VCSCommand plugin called on non-SVN item.'
@@ -148,7 +155,7 @@ endfunction
" Function: s:svnFunctions.Diff(argList) {{{2
function! s:svnFunctions.Diff(argList)
if len(a:argList) == 0
- let revOptions = []
+ let revOptions = []
let caption = ''
elseif len(a:argList) <= 2 && match(a:argList, '^-') == -1
let revOptions = ['-r' . join(a:argList, ':')]
@@ -193,7 +200,7 @@ endfunction
function! s:svnFunctions.GetBufferInfo()
let originalBuffer = VCSCommandGetOriginalBuffer(bufnr('%'))
let fileName = bufname(originalBuffer)
- let statusText = system(VCSCommandGetOption('VCSCommandSVNExec', 'svn') . ' status --non-interactive -vu "' . fileName . '"')
+ let statusText = s:VCSCommandUtility.system(s:Executable() . ' status --non-interactive -vu -- "' . fileName . '"')
if(v:shell_error)
return []
endif
@@ -287,6 +294,6 @@ endfunction
let s:svnFunctions.AnnotateSplitRegex = '\s\+\S\+\s\+\S\+ '
" Section: Plugin Registration {{{1
-call VCSCommandRegisterModule('SVN', expand('<sfile>'), s:svnFunctions, [])
+let s:VCSCommandUtility = VCSCommandRegisterModule('SVN', expand('<sfile>'), s:svnFunctions, [])
let &cpo = s:save_cpo
diff --git a/syntax/SVNAnnotate.vim b/syntax/HGAnnotate.vim
old mode 100644
new mode 100755
similarity index 75%
copy from syntax/SVNAnnotate.vim
copy to syntax/HGAnnotate.vim
index d46f771..cee9a23
--- a/syntax/SVNAnnotate.vim
+++ b/syntax/HGAnnotate.vim
@@ -1,9 +1,9 @@
" Vim syntax file
-" Language: SVN annotate output
+" Language: HG annotate output
" Maintainer: Bob Hiestand <bob.hiestand at gmail.com>
" Remark: Used by the vcscommand plugin.
" License:
-" Copyright (c) 2007 Bob Hiestand
+" Copyright (c) 2010 Bob Hiestand
"
" Permission is hereby granted, free of charge, to any person obtaining a copy
" of this software and associated documentation files (the "Software"), to
@@ -27,14 +27,14 @@ if exists("b:current_syntax")
finish
endif
-syn match svnName /\S\+/ contained
-syn match svnVer /^\s\+\zs\d\+/ contained nextgroup=svnName skipwhite
-syn match svnHead /^\s\+\d\+\s\+\S\+/ contains=svnVer,svnName
+syn match hgVer /\d\+/ contained
+syn match hgName /^\s*\S\+/ contained
+syn match hgHead /^\s*\S\+\s\+\d\+:/ contains=hgVer,hgName
-if !exists("did_svnannotate_syntax_inits")
- let did_svnannotate_syntax_inits = 1
- hi link svnName Type
- hi link svnVer Statement
+if !exists("did_hgannotate_syntax_inits")
+ let did_hgannotate_syntax_inits = 1
+ hi link hgName Type
+ hi link hgVer Statement
endif
-let b:current_syntax="svnAnnotate"
+let b:current_syntax="hgAnnotate"
diff --git a/syntax/gitAnnotate.vim b/syntax/gitAnnotate.vim
index fdc0bd1..932342d 100644
--- a/syntax/gitAnnotate.vim
+++ b/syntax/gitAnnotate.vim
@@ -28,7 +28,7 @@ if exists("b:current_syntax")
endif
syn region gitName start="(\@<=" end="\( \d\d\d\d-\)\@=" contained
-syn match gitCommit /^\x\+/ contained
+syn match gitCommit /^\^\?\x\+/ contained
syn match gitDate /\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d [+-]\d\d\d\d/ contained
syn match gitLineNumber /\d\+)\@=/ contained
syn region gitAnnotation start="^" end=") " oneline keepend contains=gitCommit,gitLineNumber,gitDate,gitName
--
vim-scripts packaging
More information about the pkg-vim-maintainers
mailing list