views:

73

answers:

2

I just installed VCSCommand and I'm getting an error of "No suitable plugin" whenever I try to run a command. I have a filed loaded in Vim that is in a directory with a mercurial repository.

I found some explanations that the "No suitable plugin" error may be displayed if you're not in a "working directory", which I took to mean that the file you're editing should be in a "working directory" of files checked out from the repository. The problem may that (as a new user to Hg) I don't grok Mercurial properly. The file I'm editing is in a directory where I created an Hg repository just to track my local changes. Commands I issued were 'hg init', then 'hg add' and I've been using 'hg commit', 'hg log', and 'hg diff' happily since. Is this directory not a "working directory" of the repo? Assuming this is the problem, how do I "checkout' the files from the hg repo into a working directory?

Or maybe the above isn't the problem with the "No suitable plugin" error at all. I do have the vcshg.vim file in the correct plugin directory, so the plugin is there.

Thanks, any help appreciated.

UPDATE: Just in case my use of mercurial was the problem I tried creating a 'clone' of my main mercurial repo and editing files in the clone. Still get same 'No suitable plugin.' message.

ALSO: I left out of original message that I'm running on Windows, and I think I've tracked things down to improper quoting of escape codes in strings. Will provide further update once I get full resolution.

A: 

First to answer the "working directory" question: your repository is your working directory. Unlike cvs/svn, you do not need to checkout files to edit. You just edit.

(FYI hg aliases its update command to checkout and co to help svn users, but hg update is a very different animal.)

Without knowing your complete environment (platform, vim installation, etc.), I can only guess that the "No suitable plugin" error is due to your VCSCommand files not in the right place. I tried its latest version 1.99.42 with my ancient vim 7.2 on cygwin by cp VCSCommand/plugin/* ~/.vim/plugin/, vim a file in an hg repo, then :VCSStatus shows me the correct result.

If you have other VCSs that VCSCommand supports (cvs, svn, svk, git, bzr), try it in one of their repositories and see if you get the same error. If you do, then it's definitely a VCSCommand installation problem.

Geoffrey Zheng
Geofrfrey -- Thanks, but I think I've tracked things down to problems with quoting of strings in Windows. I can manually change some stuff in the code and get things to run. I've submitted an issue to the project's bugtracker and will wait to see what they say: http://code.google.com/p/vcscommand/issues/detail?id=64
Herbert Sitz
I think you should post your own answer and accept it, so that it would be easier for people to find it.
Geoffrey Zheng
+1  A: 

I did get VCSCommand going fine. I think the issue had nothing to do with Mercurial, rather it had to do with problems in VCSCommand with quoting of system commands on Windows. At least that was the major problem.

To get VCSCommand working I first made sure that the variable b:VCSCommandVCSType was set to 'HG'. It was not getting set for some reason and that was why I was getting the 'No suitable plugin" error.

Second, I had to modify a line in vcshg.vim. The s:Executable() function consists of a one line 'return . . . ' function. The shellescape() wrapper around the system call was quoting improperly; after I removed that it works just fine. (Same problem may exist in the vcsXX.vim files for systems other than Mercurial, I haven't checked that.)

I think this quoting problem exists only on Windows, and may have cropped up because the main developer doesn't have a Windows machine to test on. . . .

Herbert Sitz