[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: Two people adding the same file - can both versions be merged?

From: Robert Graf-Waczenski <rgw_at_lsoft.com>
Date: 2007-05-09 15:22:54 CEST

Well, couldn't svn simply assume a rev0 as consisting of the empty file
and interpreting the first dev's changes as having occurred between
rev0 (which never existed in the repo) and rev1 by simply saying that
all lines have been added? Then, if dev2 tries to update, the usual
merge conflict would occur and dev2 would be able to merge his own
changes into the changes that svn has constructed from diffing rev0
and rev1 of the file that was added by dev1?

Robert

> -----Original Message-----
> From: news [mailto:news@sea.gmane.org]On Behalf Of Dave Lawrence
> Sent: Mittwoch, 9. Mai 2007 14:45
> To: users@subversion.tigris.org
> Subject: Re: Two people adding the same file - can both versions be
> merged?
>
>
> You can't merge two files with, what to Subversion is a non existent
> ancestor file. Consider the following
>
> developer1 and developer2 both check out rev1 of the file. Both make
> changes, and developer1 commits first, creating rev2. Now developer 2
> has to do an update before he/she can commit - subversion will attempt a
> merge as follows:
>
> 1) Take the changes between rev1 and rev2
> 2) Take the changes between rev1 and developer2's working copy
> 3) Merge them
>
> Easy to do if developer1 and developer2 were editing different parts of
> the file.
>
> Now the situation you are describing is that effectively there is a
> rev0, where the file didn't exist. How could SVN know which were
> developer1's "changes" and which were developer2's, from it's
> perspective you have both created different versions of the file from
> out of nowhere.
>
> The only merge algorithm that can be applied is that one version
> replaces the other, and how does SVN know what you want to do? The
> answer is that it doesn't and therefore you have to fix it up manually.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed May 9 15:22:20 2007

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.