You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Ryan Schmidt <su...@ryandesign.com> on 2006/05/01 21:28:34 UTC

Re: difference between svn and regular merge?

On Apr 30, 2006, at 10:25, John Joseph Bachir wrote:

> Is there any difference between how svn merges, and regular command- 
> line merge? I've asked some folks about this before, and the answer  
> is usually a vague "svn uses the file history data". I don't  
> understand what that means... I can't imagine what extra data a  
> program could have about the differences between two files. Or is  
> the magic in the merging... does it somehow incrementally and  
> therefore more "carefully" do the merges into the 3rd file?
>
> Or is there no difference at all, it's just much more convenient  
> than exporting each version and then performing the merge manually?

How would you manually perform a merge?

Subversion isn't doing any magic. It's exactly computing the  
difference between the two indicated repository locations (be they  
two revisions of one path, or two different paths), and applies the  
difference to the current working copy.

Note that the merge uses the difference computed by svn diff, but  
that the output produced by svn diff does not show all the  
information that the internal differencing algorithm is aware of. For  
example, svn diff will not tell you any information about  
directories, though the differencing algorithm is aware of directory  
changes too, and svn merge makes use of that.

Once you do a merge, the items in the working copy are modified.  
Subversion as of that point has no idea where the changes came from.  
It doesn't see any difference between changes that got performed as a  
result of a merge, and changes that were made by hand.

To do the merge by hand, you would have to determine by hand which  
directories and/or files might have to be added or removed or moved,  
do that, and also apply the diff of changes to existing files. I  
can't think of any reason to want to do that, though, since that's  
what svn merge is for, and it works great. And if it doesn't, then  
that's a bug. ;-)



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org