Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What file is saved in three way merge work with Mercurial?

I have the three way merge window open 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 is local, base, and other.

I read this How does the 3 way merge in Mercurial/Meld work? but could not get it.

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

like image 232
user26 Avatar asked Oct 22 '22 01:10

user26


1 Answers

In your example:

  • local is the last changeset on branch A.
  • other is the last changeset on branch B.
  • base is the newest changeset which is an ancestor of the both branches.

If you just do the commands that you listed above (hg update A, hg merge B) then you won't get a choice of which files to take because Mercurial will make that choice for you where it can.

The only time that you'll need to make a decision is if a file has been changed in both branches in a way that Mercurial can't automatically resolve. In that case, you'll be presented with your merge program of choice to resolve the conflicts. You have to look at the changes made in each branch and manually decide how they need to be combined. If another developer made one of the changes then you might need to ask them to help with the merge.

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

like image 62
Steve Kaye Avatar answered Oct 25 '22 20:10

Steve Kaye