2

I did what you're not supposed to do and used hg push -f to push my copy of a repo to Kiln. I did "a git" and after editing some commits (using mq) attempted to discard the old version of history by pushing a new head like that... so I don't want to merge the old head back in, just get rid of it. Is there an alternative to flushing and replacing the repository?

This is a follow-up to this question.

flag
This is also discussed here: stackoverflow.com/questions/2237222/… – Carl-Johan Sveningsson Aug 25 2010 at 8:23

3 Answers

1

I believe this is what you want:

http://mercurial.selenic.com/wiki/PruningDeadBranches

link|flag
Yep, thank you! Next time I'll need it I'd try "1. Closing branches", but the issue is obviously also that I need to do it on the server, supposedly I can push a branch close to the server and be done with it. Not gonna try it now, but marking this as correct answer, thanks a bunch! – Carl-Johan Sveningsson Aug 13 2010 at 12:54
1

You can merge but throw away all the changed from one of the heads. There is a check box option when you merge using TortoiseHG which gives you this option. I think of it a similar to SVN's "record the merge but don't do the merge" option.

link|flag
That sounds like a ridiculous merge! But possibly what I would want... :-) – Carl-Johan Sveningsson Aug 13 2010 at 12:46
I can't find that feature in the hg merge command, but it looks like #2 in Rob's answer, which is commented by: "The new merged head is based on the "eliminated" head, so it is not really eliminated. Furthermore, it is now incorporated into the main line, which actually may even be worse than simply letting that dead head alone." – Carl-Johan Sveningsson Aug 13 2010 at 12:52
0

If you find yourself with 2 heads with one corrupted

You can show your heads by: hg heads . Note the “.” at the end of the command

You cannot merge as this will bring in bad code. This procedure may help. The idea is :-

  1. hg update –rev [good-rev]
  2. hg merge –rev [bad-rev]
  3. hg revert –rev [good-rev]
  4. hg commit -m “supersede bad rev” -m scottp

This effectively undoes the bad-rev by reverting the bad-rev back to good-rev.

link|flag

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.