You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Tim Blackman <Ti...@sun.com> on 2005/06/08 19:38:32 UTC

Modifications lost when file is moved

I've run into a case where file modifications are not merged correctly
when there is parallel development and a file is moved.

Here's the case:

   Developer 1: Move file, modify file, commit
   Developer 2: Modify file, update

When developer 2 updates their working copy, their modifications to the
file don't seem to be included in the merged copy.  Instead, 'svn
status' shows their copy of the file, under the old name, marked with a
'?', and the copy with the new name only reflects changes from developer
1.

Is this known [mis]behavior?  Am I misunderstanding something?

Here's my environment:

   OS: Mac OS X 10.3.9
   Subversion: 1.2
   Statically linked build of Subversion downloaded from:
     http://homepage.mac.com/martinott/Subversion-1.2.0.pkg.zip
   No local mods
   Repository type: FSFS

I've included a bash script to reproduce the problem below.

- Tim

----------------------------------------------------------------------
#! /bin/bash

# The directories containing the repository and two working directories.
# These directories should not exist, but their parent directory should.
repos=/tmp/repos
wc1=/tmp/wc1
wc2=/tmp/wc2

# Create the repository and working directories
svnadmin create --fs-type fsfs $repos &&
mkdir $wc1 &&
svn checkout file://$repos $wc1 &&
mkdir $wc2 &&
svn checkout file://$repos $wc2 &&

# Create file1 in WC1
echo AAA > $wc1/file1 &&
svn add $wc1/file1 &&
svn commit $wc1 -m '' &&

# Update WC2
svn update $wc2

# Move file1 to file2, and prepend to it, in WC1
svn mv $wc1/file1 $wc1/file2 &&
echo 111 > $wc1/file2 &&
echo AAA >> $wc1/file2 &&
svn commit $wc1 -m '' &&

# Append to file1 in WC2
echo 222 >> $wc2/file1 &&

# Update WC2
svn update $wc2 &&

# Compare file2 to expected contents:
diff -c - $wc2/file2 <<EOF
111
AAA
222
EOF

# Check results
if [ $? != 0 ]; then echo Test failed; exit 1;
else echo Test passed; exit 0;
fi
----------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Modifications lost when file is moved

Posted by Ben Collins-Sussman <su...@collab.net>.
On Jun 8, 2005, at 12:38 PM, Tim Blackman wrote:

> I've run into a case where file modifications are not merged correctly
> when there is parallel development and a file is moved.
>
> Here's the case:
>
>   Developer 1: Move file, modify file, commit
>   Developer 2: Modify file, update
>
> When developer 2 updates their working copy, their modifications to  
> the
> file don't seem to be included in the merged copy.  Instead, 'svn
> status' shows their copy of the file, under the old name, marked  
> with a
> '?', and the copy with the new name only reflects changes from  
> developer
> 1.
>
> Is this known [mis]behavior?  Am I misunderstanding something?
>
> Here's my environment:


Subversion doesn't yet have true moves, it has copies & deletes.  The  
server is sending a delete/add combination to developer 2 when he  
updates.

This issue describes what you're seeing:

http://subversion.tigris.org/issues/show_bug.cgi?id=2282

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org