Mercurial 存储库可以嵌套吗?

发布于 2024-09-16 07:04:10 字数 280 浏览 4 评论 0原文

如果已经有一个 Mercurial 存储库

/User/peter/development

,现在我想添加一个存储库,

/User/peter

因为我还想版本 .bashrc.profile, 会发生什么情况/User/peter/notes 也是如此。在现有存储库之上拥有一个存储库是否会给 Mercurial 造成冲突?

What happens if there is already a Mercurial repository at

/User/peter/development

and now I want to add a repository for

/User/peter

because I also want to version .bashrc, .profile, or maybe /User/peter/notes as well. Will having a repository above an already existing repository create conflicts for Mercurial?

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

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

发布评论

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

评论(2

青衫负雪 2024-09-23 07:04:10

一切都会好起来的。

Mercurial 似乎足够聪明,可以忽略其中已有存储库的子目录。这是与它的对话:

$ mkdir outer
$ mkdir outer/inner
$ mkdir outer/sub
$ echo red >outer/red.txt
$ echo blue >outer/inner/blue.txt
$ echo green >outer/sub/green.txt
$ cd outer/inner/
$ hg init
$ hg add
adding blue.txt
$ hg commit -m "create inner"
$ cd ..
$ hg init
$ hg add
adding red.txt
adding sub/green.txt
$ hg commit -m "create outer"
$ hg status
A red.txt
A sub/green.txt
$ hg commit -m "create outer"

如您所见,当我添加到外部存储库时,它会忽略内部目录。

如果您想更加确定,可以将内部目录添加到 .hgignore 中。

Everything will be okay.

It seems that Mercurial is smart enough to ignore subdirectories which already have repositories in them. Here's a conversation with it:

$ mkdir outer
$ mkdir outer/inner
$ mkdir outer/sub
$ echo red >outer/red.txt
$ echo blue >outer/inner/blue.txt
$ echo green >outer/sub/green.txt
$ cd outer/inner/
$ hg init
$ hg add
adding blue.txt
$ hg commit -m "create inner"
$ cd ..
$ hg init
$ hg add
adding red.txt
adding sub/green.txt
$ hg commit -m "create outer"
$ hg status
A red.txt
A sub/green.txt
$ hg commit -m "create outer"

As you can see, when i add to the outer repository, it ignores the inner directory.

If you wanted to be extra sure, you could add the inner directory to your .hgignore.

暗藏城府 2024-09-23 07:04:10

Mercurial 中添加了一个"subrepositories" 功能版本 1.3,并且是
1.5 中支持,允许一些 hg 命令作用于嵌套存储库
递归地。

There is a "subrepositories" feature that was added to Mercurial in version 1.3, and is
supported in 1.5, which allows some hg commands to act on nested repositories
recursively.

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