是否可以从 Mercurial (HG) 存储库中签出单个目录?
因此,我尝试从 Netbeans contrib 存储库仅签出 TestNG 插件。 (或者它是模块?我是 Mercurial 的新手,所以我还不太了解行话。)
当我运行以下命令时...
hg clone http://hg.netbeans.org/main/contrib/
...我得到了整个存储库,其中包含所有的 contrib插件。是否可以只拉这个位置?
谢谢!
So, I'm trying to checkout just the TestNG plugin from the Netbeans contrib repository. (Or is it module? I'm new to Mercurial, so I don't really know the lingo yet.)
When I run the following command...
hg clone http://hg.netbeans.org/main/contrib/
...I get the entire repository, which contains all of the the contrib plug-ins. Is it possible to just pull this location?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个概念称为“窄克隆”,不,目前在 Mercurial 中不可能实现。
我们中一些为 Mercurial 做出贡献的人已经注意到了这一点,但这是一个很难解决的问题。例如:
contrib/testng
中查看某个文件的历史记录(如果该文件是从另一个文件夹移动的),会发生什么情况?This concept is called "narrow cloning" and no, it's not possible at the moment in Mercurial.
It's on the radar of some of us that contribute to Mercurial but it's a hard problem to solve. For example:
contrib/testng
if that file was moved from another folder?我不确定,但我认为一般情况下的答案是“可能不是”。
如果存储库是本地的(听起来不像您的情况),您可以执行以下操作:(
该命令需要导出非 VC 文件,而不是创建部分存储库,因为
.hg
内容在顶层存储一次,而不是像 SVN 那样在每个文件夹中分段存储。)但它不适用于远程存储库。 “hg log”也没有,hg 人员解释了原因:
我怀疑出于同样的原因,
hg archive
无法远程工作。I'm not sure, but I think the answer in the general case is "probably not".
If the repository is local (it doesn't sound like it is in your case), you can do something like:
(The command would need to be something that exports non-VC'd files, rather than creating a partial repo, since the
.hg
stuff is stored once at the toplevel, rather than in pieces in each folder as SVN does.)It doesn't work on remote repositories, though. Neither does "hg log", and the hg folks explained why:
I suspect
hg archive
can't work remotely for the same reason.