[PATCH] hgcommand.vim: refer Vim7 users to vcscommand plugin

Christian Ebert blacktrash at gmx.net
Thu Apr 17 09:07:30 CDT 2008


* Vladimir Marek on Thursday, April 17, 2008 at 14:11:44 +0200
>> * Christian Ebert on Thursday, March 13, 2008 at 16:39:40 +0100
>>> VCSCommandDoCommand has an extra mandatory "options" argument as
>>> of beta21. The following seems to work for me. Not much tested
>>> though, whether we actually need to allow non-zero exits.
>> 
>> Just for the record, there's also a non-backwards compatible
>> change in vcscommand beta20 already. The following fix to
>> vcshg.vim tries to take care of all this in a backwards
>> compatible way.
> 
> Thank you Christian for your help. I released just now newer version of
> vcsnursery:
> 
> http://www.vim.org/scripts/script.php?script_id=1898

As I already mentioned this fix is not enought, VCSAnnotate is
broken too:

VCSCommand:  Vim(let):E117: Unknown function: VCSCommandGetRevision

My patch proposals took that into account already ;)

Below is my my working (and backwards compatible) version diffed
against your vcshg.vim 2.

c


--- vcshg.vim.orig	2008-04-17 16:04:25.000000000 +0200
+++ vcshg.vim	2008-04-17 16:04:38.000000000 +0200
@@ -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-devel mailing list