回购中的Mercurial回购 [英] Mercurial repo inside a repo

查看:73
本文介绍了回购中的Mercurial回购的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在现有的汞库中创建汞库?

Is it possible to create a mercurial repository inside an existing mercurial repository?

想法是将存储库的子目录作为不同的存储库处理,您该怎么做?

The idea is to handle subdirectories of a repository as different repositories, how do you do that?

我不是在谈论subrepos(至少,如果我了解subrepos的目的...),但是如果这是subrepos确实存在的方式,那我就错了,我会尽力而为: )

I'm not talking about subrepos (at least, if I understood the purpose of subrepos...), but if this is how subrepos do exist for, I got it wrong and I'll try to get it right :)

谢谢 〜阿基

更清楚地说,我想知道在不指定模块/子存储库的情况下,在另一个存储库中建立存储库的情况,做法以及所产生的影响. 换句话说:如果我只是这样做会发生什么:

To be more clear, I'd like to know what happens, the practices and the implications of having a repository inside another one, without specifying modules/subrepos. In other words: what happens if I just do:

hg init globalRepo
hg init globalRepo/subRepo

并按原样使用这两个存储库?

and use these two repositories as-are?

推荐答案

效果很好.早在Mercurial 1.3中添加了子仓库支持之前,许多人就将他们的整个主目录保存在一个软件仓库中,以跟踪其.bashrc文件等.然后在他们的主目录中,他们将有许多其他存储库的克隆.

It works well. Long before the subrepo support was added in Mercurial 1.3, lots of folks kept their entire home directories in a mercurial repo for tracking their .bashrc files and the like. Then within their home dir they'd have many clones of other repos.

每当您调用mercurial(不带-R选项)时,它都会在当前目录中查找.hg目录,然后继续向上查找目录,直到找到目录为止.因此,如果您位于某个存储库中,那么您的命令将始终对您所在的最里面的存储库起作用.

Whenever you invoke mercurial (without the -R option) it looks in the current directory for a .hg directory and then just keeps going up directories until it finds one. So if you're in a repo that is in a repo, your commands will always act on the innermost repo you're in.

需要注意的是,您要确保不将添加到外部存储库中的文件添加到内部存储库中.然后,您将有两个存储库来更新相同的文件.

The caveat is that you want to make sure not to have files added to the outer repo that end up inside the inner repo. Then you'll have two repos updating the same files.

这篇关于回购中的Mercurial回购的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆