Mercurial 中的共享目录
我有一个 Mercurial 开发项目。在项目中,我有多个分散的目录,所有目录都应包含相同的基本文件(CSS、图像等)。
我希望所有目录都指向同一个底层目录,这样如果我在一个地方编辑文件,它就会在其他地方更新。基本上是一个到目录的 UNIX 软链接,但我希望它能在 Mercurial 中工作(我在 Windows 上)。
我查看了子存储库,但它们似乎要么指向现有目录,要么指向远程目录。我宁愿不涉及网络。就我而言,我只是将子存储库指向同一项目中的相对位置。
实现这一目标的最佳方法是什么(以最少的痛苦)?
I have a development project in Mercurial. In the project I have multiple directories scattered about which all should contain the same basic files (CSS, images, etc).
I'd like to have all of the directories point to the same underlying directory, so that if I edit a file in one place, it is updated everywhere else. Basically a UNIX soft link to the directory, but I want this to work within Mercurial (and I'm on Windows).
I've looked at subrepos, but they seem to either point to a existing directory or a remote one. I'd rather not have the network involved. In my case I just what to point the subrepos to a relative location in the same project.
What's the best way to accomplish this (with the least amount of pain)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
回到Windows 2000(但仍在NT行),您可以使用目录hard与 NTFS 的链接。然而,就 Mercurial 而言,它们将是不同的文件,只是碰巧同时更新,并且连接点不会存储在存储库中。 (我会创建一个脚本来在克隆时设置它们。)
这也与将存储库克隆到 *nix 环境不兼容。 (或者至少我不知道如何在没有转换的情况下做到这一点,这会更改存储库,这意味着您无法在它们之间推/拉。)
这是一个糟糕的黑客,但是,除非您提供更多详细信息,否则这就是我想出的一切。
Going back to Windows 2000 (but still on the NT line), you can use directory hardlinks with NTFS. As far as Mercurial is concerned, however, they would be different files that just happen to get updated simultaneously, and the junction points would not be stored in the repo. (I'd create a script to set them up when cloning.)
This would also be incompatible with cloning the repo to a *nix environment. (Or at least I don't see how you could do it without conversion, which changes the repo, which means you can't push/pull between them.)
This is a poor hack, but, barring more details from you, it was all I came up with.