I decided to stop worrying and love the bomb, it was time to edit the immutable repository history of Mercurial! Thanks to the power of hg I almost lost every changeset I was working on but in the end I succeeded in modifying a few past changesets.
I spent some time between documentation and tutorials so I'll sum up the most important commands with a brief description.
You start off by populating your queue with a few revisions with
hg qimport -r revision_start:revision_end
this will generate one .diff file in .hg/patches for each revision between revision_start and revision_end. Afterwards you remove every (with -a in the example) patch from your local repo, so that only the ones in .hg/patches exist. You do so with
hg qpop -a
and then you can edit whatever revision simply by modifying the equivalent rev.diff file. You can merge, delete and add changesets withqdelete qnew qfoldWhen you are done with modifications you just have to re-apply your revised patches with
hg qpush -a
and complete the editing with
hg qfinish -a
Not bad.
No comments:
Post a Comment