Which file is saved in the three directions of merging with Mercurial?

I have a three way merge window in Mercurial:

local base other 
  • I was on branch A: hg update A
  • I want to merge with branch B: hg merge B

I want to know what local , base and other .

I read this. How does 3D merging in Mercurial / Meld work? but could not get it.

Now I want to know which file from local , base , other do I need to save? Do I need to make all files the same? Will this change files in other branches, or will it be saved only in my current branch A, and other branches will not be affected?

+4
source share
1 answer

In your example:

  • local is the last set of changes on branch A.
  • other is the last set of changes on branch B.
  • base is the newest set of changes that is the ancestor of both branches.

If you simply execute the commands listed above ( hg update A , hg merge B ), you won’t be able to choose which files to take, because Mercurial will make this choice for you where it can.

The only time you need to make a decision is if the file has been modified in both branches in such a way that Mercurial cannot automatically resolve. In this case, you will be offered your merge program to resolve conflicts. You must look at the changes made to each branch and manually decide how to combine them. If another developer has made one of the changes, you may need to ask them to help with the merger.

If you perform hg update A , hg merge B , then the only branch that will be affected is A.

+3
source

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


All Articles