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

Re: Update can't replace missing?

From: Karl Fogel <kfogel_at_red-bean.com>
Date: Mon, 17 Nov 2008 01:01:12 -0500

Jack Repenning <jrepenning_at_collab.net> writes:
> If I "svn up" into a working copy where something has been replaced by
> an object of the wrong type (a file instead of a directory, or vice
> versa), I get no error message from 1.5.2 (I do, from 1.4.4). Further,
> the WC seems to decide I like things that way: if I remove the
> obstruction and update again, I get nothing!
>
> Is this a bug? Or am I just misunderstanding something, perhaps
> related to the new --depth magic?
>
> I get the behavior I expect out of: svn, version 1.4.4 (r25188) (OS X
> Leopard version)
>
> I get the surprising behavior out of: svn, version 1.5.2 (r32768) (I
> think this is the CollabNet download)

Using today's head of trunk (r34235), I get a buggy behavior, but one
less severe than what you saw. See below the output of a repro script I
wrote based on your script (after the output is my script itself):

   ### Making a Greek Tree for import...
   ### Done.
   
   ### Importing it...
   ### Done.
   
   ### Removing A/D...
   
   ### Restoring it by running 'svn up'...
   A A/D
   A A/D/gamma
   A A/D/G
   A A/D/G/pi
   A A/D/G/rho
   A A/D/G/tau
   A A/D/H
   A A/D/H/chi
   A A/D/H/omega
   A A/D/H/psi
   Updated to revision 1.
   
   ### Removing A/D again...
   
   ### Replacing it with a file named 'D'...
   
   ### Running 'svn up' again, with the file 'D' obstructing...
   D A/D
   Updated to revision 1.
   
   ### Hmmm. Running 'svn st', with file 'D' still obstructing...
   ~ A/D
   
   ### Okay, that's odd. 'svn up' gave code 'D'eleted, but
   ### 'svn st' correctly gives a '~' (meaning obstructed).
   ###
   ### What happens if we remove the file 'D' and run 'svn up' again?
   ### Removing file 'D'...
   
   ### Running 'svn up'...
   A A/D
   A A/D/gamma
   A A/D/G
   A A/D/G/pi
   A A/D/G/rho
   A A/D/G/tau
   A A/D/H
   A A/D/H/chi
   A A/D/H/omega
   A A/D/H/psi
   Updated to revision 1.
   
   ### It gets correctly restored. So, the only bug I see here is
   ### the printing of 'D'eleted when updating while obstructed.

And here's the script:

--------------------------------------------------------------------------
#!/bin/sh

# The next line is the only line you should need to adjust.
SVNDIR=/home/kfogel/src/subversion

SVN=${SVNDIR}/subversion/svn/svn
SVNADMIN=${SVNDIR}/subversion/svnadmin/svnadmin

# Select an access method. If svn://, the svnserve setup is
# handled automagically by this script; but if http://, then
# you'll have to configure it yourself first.
#
# URL=http://localhost/SOMETHING/repos
# URL=svn://localhost/repos
URL=file:///`pwd`/repos

rm -rf repos wc import-me

${SVNADMIN} create repos

echo "### Making a Greek Tree for import..."
mkdir import-me
mkdir import-me/trunk
mkdir import-me/tags
mkdir import-me/branches
mkdir import-me/trunk/A
mkdir import-me/trunk/A/B/
mkdir import-me/trunk/A/C/
mkdir import-me/trunk/A/D/
mkdir import-me/trunk/A/B/E/
mkdir import-me/trunk/A/B/F/
mkdir import-me/trunk/A/D/G/
mkdir import-me/trunk/A/D/H/
echo "This is the file 'iota'." > import-me/trunk/iota
echo "This is the file 'A/mu'." > import-me/trunk/A/mu
echo "This is the file 'A/B/lambda'." > import-me/trunk/A/B/lambda
echo "This is the file 'A/B/E/alpha'." > import-me/trunk/A/B/E/alpha
echo "This is the file 'A/B/E/beta'." > import-me/trunk/A/B/E/beta
echo "This is the file 'A/D/gamma'." > import-me/trunk/A/D/gamma
echo "This is the file 'A/D/G/pi'." > import-me/trunk/A/D/G/pi
echo "This is the file 'A/D/G/rho'." > import-me/trunk/A/D/G/rho
echo "This is the file 'A/D/G/tau'." > import-me/trunk/A/D/G/tau
echo "This is the file 'A/D/H/chi'." > import-me/trunk/A/D/H/chi
echo "This is the file 'A/D/H/omega'." > import-me/trunk/A/D/H/omega
echo "This is the file 'A/D/H/psi'." > import-me/trunk/A/D/H/psi
echo "### Done."
echo ""
echo "### Importing it..."
(cd import-me; ${SVN} import -q -m "Initial import." ${URL})
echo "### Done."
echo ""

${SVN} co -q ${URL}/trunk wc

cd wc
echo "### Removing A/D..."
rm -rf A/D
echo ""

echo "### Restoring it by running 'svn up'..."
${SVN} up
echo ""

echo "### Removing A/D again..."
rm -rf A/D
echo ""

echo "### Replacing it with a file named 'D'..."
touch A/D
echo ""

echo "### Running 'svn up' again, with the file 'D' obstructing..."
${SVN} up
echo ""

echo "### Hmmm. Running 'svn st', with file 'D' still obstructing..."
${SVN} st
echo ""

echo "### Okay, that's odd. 'svn up' gave code 'D'eleted, but"
echo "### 'svn st' correctly gives a '~' (meaning obstructed)."
echo "### "
echo "### What happens if we remove the file 'D' and run 'svn up' again?"

echo "### Removing file 'D'..."
rm A/D
echo ""
echo "### Running 'svn up'..."
${SVN} up
echo ""

echo "### It gets correctly restored. So, the only bug I see here is"
echo "### the printing of 'D'eleted when updating while obstructed."

cd ..

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-11-17 07:01:27 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.