[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: Ryan Schmidt <subversion-2007b_at_ryandesign.com>
Date: 2007-05-11 22:32:56 CEST

On May 10, 2007, at 02:04, Robert Graf-Waczenski wrote:

>>>> I think the point is that most of the time, when (if?) two people
>>>> add the same file, it's not guaranteed to mean the same thing or
>>>> have the same content.
>>> If two people add the file /path/to/some/deeply/nested/place/
>>> myFile.txt,
>>> what else than the same thing is this supposed to mean? (At least
>>> this
>>> is how i feel about this, especially when we talk about a source
>>> code
>>> control system).
>> I'd expect it to mean the same thing as if both had an empty file of
>> that name as a parent and different content was added by different
>> people. Does it?
> The file did not exist in the repo before, i.e. did not have an
> ancestor file (if that is what you mean by "parent").
> Both people simply meant to add the file with the same name and with
> the exact same purpose but different contents. Yes, the first
> developer
> should have talked to the second one, but apparently he didn't, so
> the second guy wasn't aware of the file having already been added
> and started to write his own version, which turned out to have
> quite important contents in it, hence the question if the contents
> can somehow be merged with the contents of the file that had been
> added by dev guy 1.

In this scenario, the second developer updates his working copy and
gets the message that myFile.txt already exists in the working copy.
To resolve the problem, he should move myFile.txt to myFile.tmp.txt,
svn update, then move myFile.txt to myFile.old.txt and move
myFile.tmp.txt to myFile.txt. Now myFile.old.txt will contain the
first developer's version, myFile.txt will contain the second
developer's version, and svn diff will show the difference between
the two, and the second developer can manually edit myFile.txt to
contain what he intends it to contain (preserving all that's
applicable from myFile.old.txt by manually copying and pasting things
in the editor) and finally commit a combined version.

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri May 11 22:33:37 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.