Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Subversion Wiki" for 
change notification.

The "SymmetricMerge" page has been changed by JulianFoad:
http://wiki.apache.org/subversion/SymmetricMerge?action=diff&rev1=72&rev2=73

Comment:
Expand "The Two Sides of a Merge"

  TODO: graph showing an indicative/abstract ancestor "O".
  
  == The Two Sides of a Merge ==
- TODO: Explain the idea that the result of a 3-way merge from branch A to B, 
committed as B3, can be seen either as a change on B consisting of the addition 
of some stuff from A, or can be seen equally validly as the change A2:B3 
consisting of the merging of recent changes on B into the context of A.  The 
fact that the result was committed on branch B does not matter; the same result 
could have been committed on branch A, or on both branches.
+ The result of a 3-way merge can be seen from two sides.  Consider this simple 
scenario:
  
- Consider a simple history (TODO: graph: O, A1, B1, B1:A2).  The changes 
committed as rA2 can been seen in two ways: either as the application of 
logical change B1 to branch A, or as the application of logical changes O:A1 to 
branch B.
+ {{attachment:merge-two-sides-1.png|Merge Two Sides 1}}
+ 
+ Usually we see this merge as a change that took place along the history of 
branch A.  We see a change A3 consisting of the addition of some changes from 
B, specifically the change B2 (strictly speaking, O:B2) into the content of A2.
+ 
+ Alternatively, and especially if we decide to use B2 as the base for a 
subsequent merge, we can see the same revision A3 as a change that occurred 
along a line of merge history that started at B2; that is, we are looking the 
change B2:A3:
+ 
+ {{attachment:merge-two-sides-1b.png|Merge Two Sides 1b}}
+ 
+ Looking from this "side" of the merge, the change B2:A3, which is the 
difference between B2 and A3, consists of the addition of change A2 (strictly, 
O:A2) into the content of B2.
+ 
+ === Symmetry ===
+ 
+ The merge is combining changes from both branches into one result, and, in 
principle, the merge process need not care which branch the result is destined 
for: the very same resulting tree of files and directories could equally well 
be produced by a merge in the other direction, from branch A to branch B:
+ 
+ {{attachment:merge-two-sides-2.png|Merge Two Sides 2}}
+ 
+ Of course, while in theory the result is independent of which branch is the 
source and which is the target, in practice the merge may give different 
results.  For example, if changes A2 and B2 both add some lines at the same 
place in a certain file, then perhaps the 3-way merge tool (or the user, for 
whom the tool is just a tool) will choose to put the source-branch lines before 
the target-branch lines in the result.  In such ways, the result may differ.  
But notice that, using a suitable 3-way merge tool and/or user input, the 
result could be guaranteed identical.
  
  == Terminology ==
   complete merge:: A merge that merges all the changes from the source branch 
that have not yet been merged into the target. A ''sync'' merge and a 
''reintegrate'' merge and a ''symmetric'' merge are all ''complete'' merges.

Reply via email to