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

Christian Ebert blacktrash at gmx.net
Mon Mar 17 04:58:28 CDT 2008


* 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.

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-devel mailing list