将两个 Mercurial 存储库加入一行修订中

发布于 2024-11-04 06:08:25 字数 1770 浏览 3 评论 0原文

创建了两个“不相关”的 Mercurial 存储库:

user@SERVER ~/mercurialtest
$ cd jointest/

user@SERVER ~/mercurialtest/jointest
$ hg init beginning

user@SERVER ~/mercurialtest/jointest
$ hg init end

user@SERVER ~/mercurialtest/jointest
$ cd beginning/

user@SERVER ~/mercurialtest/jointest/beginning
$ echo "something old..." >> data.txt

user@SERVER ~/mercurialtest/jointest/beginning
$ hg add data.txt

user@SERVER ~/mercurialtest/jointest/beginning
$ hg commit -m "Nr 1 in beginning"

user@SERVER ~/mercurialtest/jointest/beginning
$ echo "something old..." >> data.txt

user@SERVER ~/mercurialtest/jointest/beginning
$ hg commit -m "Nr 2 in beginning"

user@SERVER ~/mercurialtest/jointest/beginning
$ echo "something old..." >> data.txt

user@SERVER ~/mercurialtest/jointest/beginning
$ hg commit -m "Nr 3 in beginning"

user@SERVER ~/mercurialtest/jointest/beginning
$ cp -v data.txt ../end/
`data.txt' -> `../end/data.txt'

user@SERVER ~/mercurialtest/jointest/beginning
$ cd ../end

user@SERVER ~/mercurialtest/jointest/end
$ hg add data.txt # No shared changeset

user@SERVER ~/mercurialtest/jointest/end
$ hg commit -m "Nr 1 in end"

user@SERVER ~/mercurialtest/jointest/end
$ echo "new stuff..." >> data.txt

user@SERVER ~/mercurialtest/jointest/end
$ hg commit -m "Nr 2 in end"

user@SERVER ~/mercurialtest/jointest/end
$ echo "new stuff..." >> data.txt

user@SERVER ~/mercurialtest/jointest/end
$ hg commit -m "Nr 3 in end"

是否可能以及如何将它们连接到一个存储库中?我想从两个独立的存储库 beginning="ooO"end="Ooo" (总共有 6 次提交),它们在其中O一个存储库 joined="ooOoo" 中具有完全相同的内容(总共五个提交)。

我的原因是我已将两个分支转换为它们自己的存储库,但我真的希望将它们放在一个存储库中。除了这种方式之外,我还没有让转换工作,作为单独的存储库。

Two "unrelated" Mercurial repositories are created:

user@SERVER ~/mercurialtest
$ cd jointest/

user@SERVER ~/mercurialtest/jointest
$ hg init beginning

user@SERVER ~/mercurialtest/jointest
$ hg init end

user@SERVER ~/mercurialtest/jointest
$ cd beginning/

user@SERVER ~/mercurialtest/jointest/beginning
$ echo "something old..." >> data.txt

user@SERVER ~/mercurialtest/jointest/beginning
$ hg add data.txt

user@SERVER ~/mercurialtest/jointest/beginning
$ hg commit -m "Nr 1 in beginning"

user@SERVER ~/mercurialtest/jointest/beginning
$ echo "something old..." >> data.txt

user@SERVER ~/mercurialtest/jointest/beginning
$ hg commit -m "Nr 2 in beginning"

user@SERVER ~/mercurialtest/jointest/beginning
$ echo "something old..." >> data.txt

user@SERVER ~/mercurialtest/jointest/beginning
$ hg commit -m "Nr 3 in beginning"

user@SERVER ~/mercurialtest/jointest/beginning
$ cp -v data.txt ../end/
`data.txt' -> `../end/data.txt'

user@SERVER ~/mercurialtest/jointest/beginning
$ cd ../end

user@SERVER ~/mercurialtest/jointest/end
$ hg add data.txt # No shared changeset

user@SERVER ~/mercurialtest/jointest/end
$ hg commit -m "Nr 1 in end"

user@SERVER ~/mercurialtest/jointest/end
$ echo "new stuff..." >> data.txt

user@SERVER ~/mercurialtest/jointest/end
$ hg commit -m "Nr 2 in end"

user@SERVER ~/mercurialtest/jointest/end
$ echo "new stuff..." >> data.txt

user@SERVER ~/mercurialtest/jointest/end
$ hg commit -m "Nr 3 in end"

Is it possible and how do I join them together into one repository? I want to go from two separate repositories beginning="o-o-O", end="O-o-o" (with a total of six commits) where they have exactly the same content in O to one repository joined="o-o-O-o-o" (with a total of five commits).

My reason is that I have converted two branches into their own repositories, but I really want them in one instead. I haven´t gotten the convert to work except this way, as separate repositories.

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

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

发布评论

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

评论(1

苍景流年 2024-11-11 06:08:25

转换扩展可以使用--splicemap来做到这一点。

The convert extension can do that, using --splicemap.

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