[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-08 16:26:19 CEST

No, it wouldn't because developer 2 had already began working on his version
of the file, i.e. he created the file myFile.txt with his own changes and
then issued "svn add myFile.txt". Meanwhile, developer 1 also created
myFile.txt with his own (and different) changes, then said "svn add
myFile.txt" and commited before developer 2 had a chance to commit. So "svn
update" failed for developer 2, complaining about the already existing file.

Robert
  -----Original Message-----
  From: Chris.Fouts@qimonda.com [mailto:Chris.Fouts@qimonda.com]
  Sent: Dienstag, 8. Mai 2007 16:07
  To: users@subversion.tigris.org
  Subject: RE: Two people adding the same file - can both versions be
merged?

  I wonder if an "svn update" (instead of the renaming, co, renaming back
deal)
  would have worked?

----------------------------------------------------------------------------
    From: Robert Graf-Waczenski [mailto:rgw@lsoft.com]
    Sent: Tuesday, May 08, 2007 2:57 AM
    To: Subversion Users
    Subject: Two people adding the same file - can both versions be merged?

    Hi svn gurus,

    yesterday this issue here came up: Two developers have independently of
each other started working on a to-be-added-to-svn file. One developer was
first to add the file and was able to commit successfully. The second
developer had no such luck. He added the file (containing his own changes)
and of course the commit attempt failed because svn reported that the file
already exists. So, in terms of SVN, no error occurred. However, the
question that i was unable to answer in a satisfactory way was: Is it
possible to merge the changes that the second developer had in his version
of the file to the contents of the file that had already been added to the
repo?

    We resolved the issue by having the second developer first rename his
file, then checkout the version that the first developer had added and then
using local wc merge tools (i.e. manual inspection in our case) to merge the
changes of developer 2 with the changes of developer 1.

    Is there any other, more automated method of resolving such an issue?
Received on Tue May 8 16:25:43 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.