[vcscommand.vim] patch for vcshg.vim

Christian Ebert blacktrash at gmx.net
Sun Mar 16 10:37:41 CDT 2008


Hi,

For those who use the vcscommand/vcshg.vim combo in conjunction
with hg:

In the latest versions of vcscommand.vim (beta20,21) changes
incompatible with vcshg.vim have been made.

Until Vladimir has time to update vcshg.vim you can try the
following patch -- should be backwards compatible too.

c



--- vcshg.vim.orig	2008-03-13 16:33:19.000000000 +0100
+++ vcshg.vim	2008-03-15 19:34:34.000000000 +0100
@@ -102,7 +102,13 @@
   try
     if VCSCommandGetVCSType(expand('%')) == 'Mercurial'
       let fullCmd = VCSCommandGetOption('VCSCommandHGExec', 'hg') . ' ' . a:cmd
-      return VCSCommandDoCommand(fullCmd, a:cmdName, a:statusText)
+      try
+         let l:docmd = VCSCommandDoCommand(fullCmd, a:cmdName, a:statusText, {})
+      catch /:E118/
+        " vcscommand < beta21
+         let l:docmd = VCSCommandDoCommand(fullCmd, a:cmdName, a:statusText)
+      endtry
+      return l:docmd
     else
       throw 'No suitable plugin'
     endif
@@ -145,7 +151,10 @@
         " Perform annotation of the version indicated by the current line.
         let revision = matchstr(getline('.'),'\v^\s*\S*\s*\zs\d+')
       else
-        let revision=VCSCommandGetRevision()
+        if !exists('b:VCSCommandBufferInfo')
+          call VCSCommandEnableBufferSetup()
+        endif
+        let revision = b:VCSCommandBufferInfo[0]
         if revision == ''
           throw 'Unable to obtain version information.'
         elseif revision == 'Unknown'        " XXX


More information about the Mercurial mailing list