質問

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...

役に立ちましたか?

解決

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.

他のヒント

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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top