在 Mercurial 中使用 VCSCommand Vim 插件时出现问题

发布于 2024-09-24 08:35:22 字数 636 浏览 4 评论 0原文

我刚刚安装了 VCSCommand,每当我尝试运行命令时,都会收到“没有合适的插件”错误。我在 Vim 中加载了一个文件,该文件位于包含 Mercurial 存储库的目录中。

我发现一些解释,如果您不在“工作目录”中,可能会显示“没有合适的插件”错误,我认为这意味着您正在编辑的文件应该位于检查的文件的“工作目录”中从存储库中取出。问题可能是(作为 Hg 的新用户)我没有正确理解 Mercurial。我正在编辑的文件位于我创建 Hg 存储库的目录中,只是为了跟踪我的本地更改。我发出的命令是“hg init”,然后是“hg add”,从那以后我一直在愉快地使用“hg commit”、“hg log”和“hg diff”。该目录不是存储库的“工作目录”吗?假设这就是问题所在,我如何将 hg 存储库中的文件“签出”到工作目录中?

或者上面的问题根本不是“没有合适的插件”错误。我确实有 vcshg.vim文件位于正确的插件目录中,所以插件就在那里。

谢谢,任何帮助

更新:以防万一我使用 Mercurial 出现问题,我尝试创建我的主 Mercurial 存储库的“克隆”并在克隆中编辑文件。仍然得到相同的“没有合适的插件”。 另外:

我遗漏了我在 Windows 上运行的原始消息,我认为我已经追踪到字符串中转义码的不正确引用,一旦我得到完整的解决方案,将提供进一步的更新。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

涫野音 2024-10-01 08:35:22

我确实让 VCSCommand 进展顺利。我认为这个问题与 Mercurial 无关,而是与 VCSCommand 中引用 Windows 系统命令的问题有关。至少这是主要问题。

为了使 VCSCommand 正常工作,我首先确保变量 b:VCSCommandVCSType 设置为“HG”。由于某种原因它没有被设置,这就是为什么我收到“没有合适的插件”错误。

其次,我必须修改 vcshg.vim 中的一行。s:Executable() 函数由一行“return”组成. ' 函数周围的 shellescape() 引用不正确;在我删除它之后,它工作得很好(除了 Mercurial 之外的系统中也可能存在同样的问题,我没有检查过) )

我认为这个引用问题只存在于 Windows 上,并且可能是因为主要开发人员没有 Windows 机器来测试 .

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

慵挽 2024-10-01 08:35:22

首先回答“工作目录”问题:您的存储库您的工作目录< /a>.与 cvs/svn 不同,您不需要签出文件进行编辑。你只需编辑即可。

(仅供参考,hg 将其 update 命令别名为 checkoutco 以帮助 svn 用户,但是 hg update 是一个非常有用的命令。不同的动物。)

在不知道你的完整环境(平台,vim安装等)的情况下,我只能猜测“没有合适的插件”错误是由于你的VCSCommand文件不在正确的位置。我在 cygwin 上使用古老的 vim 7.2 尝试了最新版本 1.99.42,通过 cp VCSCommand/plugin/* ~/.vim/plugin/vim hg 中的文件repo,然后 :VCSStatus 显示正确的结果。

如果您有 VCSCommand 支持的其他 VCS(cvs、svn、svk、git、bzr),请在其存储库之一中尝试一下,看看是否会出现相同的错误。如果是这样,那么肯定是 VCSCommand 安装问题。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文