how to combine old revisions into one?

TJ tj at dir.bg
Fri Aug 26 18:48:18 UTC 2011


Hello!

I've got a repository. In the middle of its life-cycle I deleted a lot 
of unnecessary files from it  (I decided to keep  them unversioned).
hg remove
hg commit


The repo grows bigger and bigger.

And I decided to get rid of old revisions the from initial one to the 
revision where lot of files were removed (let's name it X).
Other words I want combine these revisions (from the initial to the X) 
into one initial revision.

But same time to keep the history of the following revisions (X+1, 
etc..) as they are.

I googled for the solution, but failed.

And found nothing clever than do this:

hg init newrepo
cd oldrepo
hg archive -r X newrepo
hg export -r X+1: -o "~/patches/%R-%h.diff"
cd newrepo
hg commit -A -m 'initial release (after archiving)'
hg import ~/patches/*.diff


And damn it, after few successfully applied patches
I receive:

Hunk #1 FAILED at xxx
Hunk #2 FAILED at xxx
2 out of 2 hunks FAILED -- saving rejects to file xxx.rej
abort: patch failed to apply


What I do wrong?

I've got 1 repo without branches (to be more exact to the revision X all 
branches were merged).


Thank you for advices!

TJ.



More information about the Mercurial mailing list