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

"Bug" in Update and Merge

From: Carlo Hogeveen <Carlo.Hogeveen_at_nccw.nl>
Date: 2005-11-18 13:57:16 CET

When updating or merging SVN either merges differences or generates a
conflict. The way I hear people talking about SVN an update or merge
without a conflict implies success to them, when obviously something as
generic as SVN cannot possibly be that smart. SVN just updates/merges
line-based, and a "successful" update/merge can still cause an erroneous
result, as I demonstrate in the example below. I am new to SVN, and
wonder why I don't see this mentioned anywhere.

Obviously this is not a bug in the SVN application. It is just how SVN
currently works, and as long as we also check our automatic updates and
merges there is no harm. IMHO it is a "bug" in the documentation. An
explicit mention there, and possibly in the FAQ, could avoid the
unawareness that I notice.

I am contemplating making all files binary in SVN to avoid automatic
updates and merges. An option in SVN to turn off automatic updates and
merges would seem a nice safety feature.

Example, as tested with SVN:

The program below is in the repository, and checked out by Harry and
Sally:

   salary = 1000
   bonus = 50
   taxes = 300

   salary = salary + bonus

   // Isn't that too bad: We also have to pay taxes.
   // Sombody will have to program the subtraction of taxes later on.

   print salary

Harry changes his working copy to the program below, and checks it in:

   salary = 1000
   bonus = 50
   taxes = 300

   salary = salary + bonus - taxes

   // Isn't that too bad: We also have to pay taxes.
   // Sombody will have to program the subtraction of taxes later on.

   print salary

Sally changes her working copy to the program below, does a "successful"
svn update, and checks the result in:

   salary = 1000
   bonus = 50
   taxes = 300

   salary = salary + bonus

   // Isn't that too bad: We also have to pay taxes.
   // Sombody will have to program the subtraction of taxes later on.

   salary = salary - taxes
   print salary

The repository now contains the end-result, which is a program that
makes us pay taxes twice!

   salary = 1000
   bonus = 50
   taxes = 300

   salary = salary + bonus - taxes

   // Isn't that too bad: We also have to pay taxes.
   // Sombody will have to program the subtraction of taxes later on.

   salary = salary - taxes
   print salary

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Nov 18 13:59:20 2005

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.