Question

I've just found out that someone committed some time ago some changes locally, that was revision #410, now the right version is #638... that created a branch in that person's mercurial history, and I want to get rid of it... I tried to execute an Undo > Backout... but it won't let me...

The error message I got is:

error message

That person's Mercurial history:

Branch that was never pushed

What can I do to get rid of that branch? The changes that it was supposed to do were already made some revisions ago...

Was it helpful?

Solution

That error appears to be because you are on a different branch then the following will probably work:

hg up -r 410
hg backout -r 410
hg merge
hg commit

However, this will add an irrelevant changeset and a merge that you don't care about. You could simply do this, instead:

hg clone -r tip repo repo1      # This should strip the unwanted changeset
cp repo/.hg/hgrc repo1/.hg/hgrc # This will copy any repo customizations
rm -rf repo                     # Delete original repo
mv repo1 repo                   # Replace original repo

The above commands are Unix/Linux commands and it appears you might be on Windows. If you are, just replace the commands with the Windows equivalent. If you don't understand, I can edit my answer.

OTHER TIPS

You can use the strip command of the mq-extension like: hg strip 410

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top