Merging bookmarks into mercurial

After I asked this question yesterday about branching in mercurial, I decided to try bookmarks for short-lived branches (functions), as shown below.
However, now when I try to combine my bookmarks with bookmarks in the development editor, I get the following error:

hg update dev-1.1 hg merge feature1 abort: nothing to merge 

What am I doing wrong?

Graphical representation of my repo:

 o changeset: 5:fa2b19961b46 | bookmark: feature1 | description: Work on feature 1 finished. | | o changeset: 4:6ea0155d4d89 | | bookmark: feature2 | | description: Work on feature 2 started. | | o | changeset: 3:44e335b5426c | | bookmark: feature1 |/ description: Work on feature#1 started. | @ changeset: 2:407b3b94624f | tag: dev-1.1 | description: Development for release 1.1 started. 
+6
source share
2 answers

As they say, there is nothing to merge - instead, you should use the update:

 $ hg update feature1 

You can only combine different parts of the story, and here the dev-1.1 changelog is simply the ancestor of feature1 . Mercurial 2.1 says that

 $ hg merge feature1 abort: nothing to merge (use 'hg update' or check 'hg heads') 

in this case, and we hope that this will make the mistake clearer.

If you checked dev-1.1 (instead of tagging it), then simple

 $ hg update 

now (with Mercurial 2.1) will lead to updating the dev-1.1 bookmark. Therefore, if you start with

 $ hg bookmarks * dev-1.1 0:b1163a24728f feature1 3:c84f04513651 feature2 2:e60dd08af282 

and then update:

 $ hg update 2 files updated, 0 files merged, 0 files removed, 0 files unresolved updating bookmark dev-1.1 

then the bookmark is updated:

 $ hg bookmarks * dev-1.1 3:c84f04513651 feature1 3:c84f04513651 feature2 2:e60dd08af282 

With earlier versions you will need to do

 $ hg update feature1 $ hg bookmark -f dev-1.1 

This still applies if a simple hg update does not lead you to the desired set of changes, for example, if you wanted to merge using feature2 .


The idea of ​​using merging when the story really does not diverge comes from Git. This system has the concept of quick merge, which we call an update in Mercurial.

+11
source

If the changes were made public, you can force Mercurial to merge if you want to insist that each function be merged in the repository:

 $ hg update feature1 $ hg debugsetparents dev-1.1 feature1 $ hg commit -m 'Feature 1 reviewed by me.' $ hg bookmark -d feature1 

If the changes are not made public, you can collapse the set of changes into one:

 $ hg update feature1 $ hg rebase --dest dev-1.1 --collapse $ hg bookmark -d feature1 
+3
source

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


All Articles