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

Odd behaviour when merging.

From: Erik Enge <eenge_at_prium.net>
Date: 2005-09-14 01:06:11 CEST

The company I work for is in the process of validating that
Subversion will work as a replacement for CVS, we have run
into a somewhat odd problem which I would like to show you and
perhaps get some insight into either what I'm doing wrong or
what might be going on. Please bear with me during the following
exercise (some Subversion output has been removed but I left
the A/U/Gs etc to illustrate exactly what Subversion responds
with each time I interact with it, more information can be
provided if this is not sufficient):

User A adds a file called ``test'' to the repository:

usera$ echo -en "line0\nline1\n\n" > test
usera$ od -h test
0000000 696c 656e 0a30 696c 656e 0a31 000a
0000015
usera$ svn add test
A test
usera$ svn commit test -m "adding test file with three lines;
last line empty"

User B checks out the file just added by user A:

userb$ svn up
A test

User B decides that this is garbage and replaces the file with
one empty line (note that if you replace it with a completely
empty file - eg echo -n "" > test - you'll get a conflict later
on):
userb$ echo -en "\n" > test
userb$ od -h test
0000000 000a
0000001

In the mean time, User A changes line 3:

usera$ echo -en "line0\nline1\nline2\n\n" > test
usera$ od -h test
0000000 696c 656e 0a30 696c 656e 0a31 696c 656e
0000020 0a32 000a
0000023
usera$ svn commit test -m "oh, forgot line2, just added it,
pushed the newline down one"

Ok, here's my thinking at this point: When user B now updates his
repository he should get a conflict for that file. He has changed
line 3 (he removed it) and so did user A (he changed the contents of
it), however it merges fine:

userb$ svn up
G test

and now contains:

userb$ cat test
line2

userb$ od -h test
0000000 696c 656e 0a32 000a
0000007

Am I confused or is there something weird going on? I'm sorry for the
contrived example however this occurred for us in our testing in real
world code; the test file and its contents as above is the result of
my boiling down our real world example. There might still be
possibilities for making the example even shorter but I think this is
sufficiently short.

I was wondering if this were related to
<http://subversion.tigris.org/issues/show_bug.cgi?id=418>.

Thanks,
Erik.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Sep 14 01:28:00 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.