Pressing multiple heads with Mercurial

For such a workflow

$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 read a lot, saying: "NEVER use push -f to force."

But yes, the experimental chapter must be pressed, since I do not want to merge until it is stable enough. I don’t want to save the changes in this bookmark for too long on my machine (what happens if the system crashes?), And I would like to pull this bookmark and continue the experiments later. However, this is a kind of "centralized" approach. What is the best way to handle the situation? Is there a way to use bookmarks to solve this workflow? Do not want to use a named branch.

Note. I just used "push -f", but Bitbucket never shows these bookmarks in the "Tags" links of the repositories.

+6
source share
1 answer

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

Bookmarks will not appear on the bitbucket. Of course, the changes will be displayed as chapters, but the boomers are not saved in the repo. When two versions of 1.6 or a later version of Mercurial push / pull change, they transfer bookmarks out of range, but bitbucket does not yet have support (as far as I know).

+11
source

Source: https://habr.com/ru/post/885957/


All Articles