将两个 Mercurial 存储库加入一行修订中
创建了两个“不相关”的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
转换扩展可以使用
--splicemap
来做到这一点。The convert extension can do that, using
--splicemap
.