Motivation
Do you want to run a merge operation and you already know you want to keep the destination or the source contributor? This article will explain the two different types of conflicts where you can preselect the conflict resolution.
Automatic resolution for regular conflicts
For regular file conflicts, the "keepsource" and "keepdestination" are available. Use them to preserve one of the two contributors:
- --keepsource: Accepts all changes from source contributor.
(This is only available for a normal merge, but not for
ancestor, or cherrypicking.) - --keepdestination: Preserves changes from destination contributor.
(This is only available for a normal merge, but not for
ancestor, or cherrypicking.)
Automatic resolution for directory conflicts
For directory conflicts, check this chapter of our Plastic SCM Book if you are not sure what they are https://plasticscm.com/book/#_directory_merges, you can also select the result of the merge, each conflict will help you to choose the source or the destination contributor, check this example:
cm merge cs:2634 --merge --automaticresolution=eviltwin-src;changedelete-src
The above merge operation from the changeset 2634 will resolve the "eviltwin" and "changedelete" conflicts keeping the source ("-src") contributor. The merge command uses the "-src" suffix to keep the source contributor changes; on the other hand, the merge command uses the "-dst" suffix to keep the destination contributor changes.
Find below the complete list of conflicts the merge command supports:
- movedeviltwin
- eviltwin
- changedelete
- deletechange
- movedelete
- deletemove
- loadedtwice
- addmove
- moveadd
- divergentmove
- cyclemove
You can also use "all-dst" or "all-src" to resolve all the directory conflicts the same way
--automaticresolution=all-dst
--automaticresolution=all-src