Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resolving conflicts: how to accept "their" changes automatically?

Tags:

mercurial

When merging conflicting changes using hg merge, Mercurial inserts a set of markers into the files to be merged in my working copy like this:

<<<<<<< local   version = 0.2 =======   version = 0.1 >>>>>>> other 

Then I manually edit all files marked as U from a list produced by hg resolve --all -l and then I tell mercurial I have resolved them by hg resolve -m file1 file2 file3 ...

In many situations I would like however accept either my-only or their-only changes on some conflicting files. I am thinking to create two simple sed/awk/whatever scripts named accept-theirs.sh and accept-my.sh or is there any "proper" way to do it?

like image 863
psihodelia Avatar asked Mar 21 '13 10:03

psihodelia


People also ask

How do I accept all incoming changes in merge conflict?

right click file with conflicts without left-click / opening file in editor pane. click "Accept all Incoming" / "Accept all Current"


1 Answers

Use

hg resolve -t internal:other --all 

to accept theirs and

hg resolve -t internal:local --all 

to accept yours

like image 161
Noffls Avatar answered Sep 28 '22 03:09

Noffls