解决 Mercurial 和 IntelliJ IDEA 项目根不匹配问题?
我有一个 Mercurial 存储库,其中有几个项目(从 IntelliJ IDEA 意义上来说)。例如,我可能有:
foo/
projects/
project1/
.idea/
project2/
.idea/
我可以使用命令行和 TortoiseHG 进行推送、拉取、提交等操作。我已经在 IntelliJ 中启用了 Mercurial(hg4idea 插件),但几乎没有任何效果。如果我添加源代码文件,它不会被添加,对于我手动添加的文件,它们不会显示任何更改。在 IntelliJ 中,Mercurial 菜单已启用,但“添加到 VCS”始终呈灰色。但是,IntelliJ 正确列出了远程存储库中的可用变更集。
在“hg status”等命令的版本控制窗口中,我收到如下错误:
abort: repository C:/foo/projects/project1 not found!
“hgcoming”等命令似乎正在成功。
我怀疑这可能是因为项目根(project1)位于存储库根(foo)之下。有谁知道如何解决这个问题?我可以更改配置吗?如果有的话,是在哪里设置的?
我正在使用最新的 (10.0.3) IntelliJ IDEA 社区版。
I have a mercurial repository which has several projects (from an IntelliJ IDEA sense) within it. for example, I might have:
foo/
projects/
project1/
.idea/
project2/
.idea/
I can push,pull,commit etc fine with command-line and TortoiseHG. I've enabled Mercurial (hg4idea plugin) within IntelliJ yet almost nothing seems to be working. If I add a source code file it doesn't get added, for files I've added manually they show no changes. In IntelliJ the Mercurial menu is enabled but "add to VCS" is always greyed out. However, IntelliJ correctly lists available changesets from a remote repository.
In the Version Control window for commands like "hg status" I get errors like:
abort: repository C:/foo/projects/project1 not found!
Commands like "hg incoming" seem to be succeeding.
I suspect this might be because the project root (project1) is below the repository root (foo). Does anyone know how to resolve this problem? Is there a configuration change I can make? If so, where in the settings is it?
I'm using the latest (10.0.3) IntelliJ IDEA Community edition.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我自己设法解决了这个问题。当您为 Mercurial 启用项目时,IntelliJ 默认将项目根设置为 Mercurial 存储库目录。借助此帮助页面的帮助,我发现这就是我所需要的改变。
这会更改 .idea 目录中的 vcs.xml 文件。
I managed to work this one out myself. When you enable the project for Mercurial, IntelliJ sets the project root by default as the mercurial repository directory. With the help of this help page I worked out this was what I needed to change.
This changes the vcs.xml file in the .idea directory.
Nick 提供的步骤适用于类似的设置,多个项目位于同一个 Mercurial 存储库中。
我担心 IDEA 会在 vcs.xml 中使用绝对路径,但它更智能:
The steps provided by Nick work for me in a similar setup with multiple projects living in the same Mercurial repository.
I was worried that IDEA would use absolute paths in vcs.xml but it's more intelligent: