How should I manage "reverting" a branch done with bookmarks in mercurial?

Posted by Earlz on Programmers See other posts from Programmers or by Earlz
Published on 2012-10-27T03:46:41Z Indexed on 2012/10/27 5:16 UTC
Read the original article Hit count: 412

Filed under:
|
|

I have an open source project on bitbucket. Recently, I've been working on an experimental branch which I (for whatever reason) didn't make an actual branch for. Instead what I did was use bookmarks.

So I made two bookmarks at the same revision

  • test --the new code I worked on that should now be abandoned(due to an experiment failure)
  • main -- the stable old code that works

I worked in test. I also pushed from test to my server, which ended up switching the tip tag to the new unstable code, when I really would've rather it stayed at main. I "switched" back to the main bookmark by doing a hg update main and then committing an insignificant change. So, I pushed this with hg push -f and now my source control is "correct" on the server.

I know that there should be a cleaner way to "switch" branches. What should I do in the future for this kind of operation?

© Programmers or respective owner

Related posts about version-control

Related posts about mercurial