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.
The convert extension can do that, using --splicemap
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With