Remove a revision in TortoiseHG and Mercurial
Asked Answered
Q

2

6

In my repository I needed to revert to an older revision. I did reverting and made the changes I needed to. How do I push the new revision upstream?

I was on rev 17 when I needed to revert back to rev 13. Now that I've made my changes, I'm on rev 18. Thing is, when I go to push these changes up (I'm using TortoiseHG), I get an error "abort:push create new remote head.

I don't want to do a merge. Do I want to do a force with the --force command or do I need to delete rev 14-17. If I need to delete, how do I delete 14-17.?

Quackenbush answered 14/8, 2012 at 18:6 Comment(0)
M
12

Proper solution is to actually merge with option Discard all changes from merge target (other) revision. But sometimes life is harder on us and we really need to drop some changes (eg. we committed nuclear launch codes or some other security sensitive data). Is that your case? If yes then follow.

Assuming that original changes were not published you could:

  • enable mq extension
  • r-click on offending changes and execute Modify history->Strip. This will permanently remove changes from your local history.
Marocain answered 15/8, 2012 at 5:4 Comment(0)
S
3

You don't want to delete revisions and therefore destroy history. That goes against the reason version control exists.

You can do a merge and discard.

You can also do this in tortoiseHG.

enter image description here

Scotfree answered 14/8, 2012 at 19:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.