Combining two repositories

Ernie Rael errael at raelity.com
Wed Jul 12 01:07:33 UTC 2023


Many thanks to John and Paul. Great info.

I was stuck on the idea that convert was the right way to do it. Given 
that, I should have read its help better, particularly second sentence 
about splicemap.

    or graft two disconnected series of history together

The replies got me unstuck. I tried it with pull-pull-merge, 
pull-splicemap, pull-transplant, pull-pull-rebase. Hopefully the idea 
sticks... I'll probably go with merge since the graph visually 
encapsulates the whole idea.

-ernie

PS The SO post is fascinating, I may try  some things around that to 
improve my sense of wonder.

On 23/07/11 2:45 PM, John W wrote:
>> Is there something like an append option I can't find?
> There's some good info on this SO post:
> https://stackoverflow.com/questions/10448788/merging-two-different-repositories
>
> Regardless, the first step is likely to combine the repos with 'hg
> pull --force'. Then, you can fix up history from there.
>
> Some options:
>
> * Use the 'splicemap' approach described in the above post, to leave
> you with linear history.
> * Use 'hg rebase' to accomplish something similar.
> * Use MQ to turn one of the repos' history into patches, then apply
> those patches on top of the other repo (basically the same as
> 'rebase', but more manual).
> * Leave it alone, and just merge the two heads. You'll have a slightly
> strange "two roots" repo.
>
> Regardless, you will likely want to do the hg->hg convert step you
> initially described, using a filemap, to make sure everything is in
> the right place before you do the final combine+fixup. This helps
> reduce conflicts (eg: same-named files — details will depend on your
> specific case).
>
> -John
>
> On 7/11/23, Ernie Rael<errael at raelity.com>  wrote:
>> Greetings,
>>
>> I started something with two repositories, thinking I might combine them
>> later using "hg convert". I can't get that to work. If I do
>>
>>      hg convert repo1 target-repo
>>      hg convert repo2 target-repo
>>
>> then repo1 is not in target-repo. There's a simple filemap involved with
>> each, but I get the same problem without them.
>>
>> Is there something like an append option I can't find? Some other way to
>> do what I'm looking for?
>>
>>      $ hg version -v
>>      Mercurial Distributed SCM (version 6.4.3)
>>
>>      Enabled extensions:
>>
>>         convert     internal
>>         evolve      external  11.0.1
>>         ...
>>
>> -ernie
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20230711/cdcf3293/attachment.html>


More information about the Mercurial mailing list