Add earlier history retroactively?

Tom Widmer tom.widmer at gmail.com
Sat Apr 10 12:56:57 CDT 2010


Tom Widmer wrote:
> Nikolaus Rath wrote:
>> Hello,
>>
>> I have a project that was initally managed in subversion. At some point
>> I created a Mercurial repository and imported the most recent subversion
>> revision. From that point on, the project was managed in Mercurial.
>>
>> Now I have noticed the existence of "hg convert" to convert the entire
>> history of a subversion repository. However, it seems to insist on
>> creating a fresh mercurial repository.
>>
>> Is it also possible to retroactively add the old subversion history to
>> an already existing mercurial repository? How would I go about that?
> 
> Using hg convert, which can convert from HG to HG surprisingly!
> 
> Say your new history since your move to HG is in repoA.
> 
> Use hg convert to create a fresh HG repo from the old SVN history, call 
> it repoB. Use hg convert --splicemap to convert from repoA with the 
> target set to repoB, and a splicemap containing:
> <full sha hash of the final rev of repoB> <full sha hash of the 2nd rev 
> of repoA>

Actually, that's backwards, and should be:
<full sha hash of the 2nd rev of repoA> <full sha hash of the final rev 
of repoB>

The format for the splicemap file is 1+ lines containing:
<child sha> <parent1 sha> (<parent2 sha>)

Tom



More information about the Mercurial mailing list