Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pushing multiple heads with Mercurial

For a workflow like this,

$hg clone <bitbucket repo>
... fix, fix ...
$hg commit -m "good comment!"

$hg bookmark stable 
...new fix on stable...
$hg commit -m "new fix on stable bookmark"

$hg bookmark experimental --> I would like to defer merging until its stable.
... hack hack more hack ....
$hg commit -m "more hack on experimental"
$created new head

$hg push <bitbucket repo>
"abort: push creates new remote heads!"
(did you forget to merge? use push -f to force)

I've read a lot saying 'NEVER EVER use push -f to force'.

But yes, the experimental head needs to be pushed, as I don't want to merge untill its stable enough. I don't want to keep the changes on this bookmark on my machine for too long either (what happens if system got crashed?) and I'd like pull this bookmark and continue experiments later. Its a kind of 'centralized' approach though. Whats the best way to deal with kind of situation ? Is there any way to use bookmarks to deal this workflow? Don't want to use named branch.

Note: I just used 'push -f', but Bitbucket never shows this bookmarks on repositories 'Tags' link.

like image 630
sojin Avatar asked Apr 15 '11 03:04

sojin


1 Answers

What you're doing is just fine. The "don't use push -f" is advice for people who have pulled, have multiple heads, and don't know what that means.

Bookmarks won't show up on bitbucket. The changesets will show up as heads, of course, but the boomarks aren't stored in the repo. When two version 1.6 or later Mercurial's push/pull changesets they transfer bookmarks out-of-band, but bitbucket doesn't have support for that yet (to my knowledge).

like image 51
Ry4an Brase Avatar answered Sep 22 '22 23:09

Ry4an Brase