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

Possible bug: when deleting a file scheduled for addition with some property modifications subversion leaves a .svn-work property file

From: Alexander Sinyushkin <Alexander.Sinyushkin_at_svnkit.com>
Date: 2007-11-01 19:32:43 CET

Hello, devs! I don't know whether it's a bug or not, but it looks like a
bug. And I am also not aware of whether it has already been published,
sorry if so.

Now about the problem itself. I have noticed that if I add a file, then
set some properties on it and then delete it after all, subversion does
not erase a working property file though. Here is a little script to
reproduce the problem (I remember Karl Fogel once asked me to send some
script in such cases, I modified his one):





rm -rf repos wc wc2 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 ""

echo "### Check out:"
${SVN} co -q ${URL}/trunk wc
echo "### Done."
echo ""

echo "### Create a file theta and schedule it for addition:"
cd wc
echo "This is the file 'theta'." > theta
${SVN} add -q theta
echo "### Done."
echo ""

echo "### Set a foo=bar prop on theta:"
${SVN} ps -q foo bar theta
echo "### Done."
echo ""

echo "### Now force deletion of theta:"
${SVN} delete -q --force theta
echo "### Done."
echo ""

echo "### Now check if ./svn/props/theta.svn-work exists (it should not):"
cd .svn/props
if ls | grep --silent theta.svn-work; then
    echo ' *** PROBLEM: wc props file for a deleted file still
presents, though it should not; look into wc/.svn/props'
    echo ' *** all is just fine, no bugs :)'
echo "### Done."
echo ""
cd ..
cd ..
cd ..

I think the problem is that in the svn_wc_delete3 function (adm_ops.c) a
base prop file is removed instead of a working one:

--- adm_ops.c 2007-11-01 22:49:36.000000000 +0600
+++ adm_ops.c.modified 2007-11-01 22:51:29.000000000 +0600
@@ -1292,7 +1292,7 @@
        if (was_schedule == svn_wc_schedule_add)
          SVN_ERR(svn_wc__loggy_props_delete(&log_accum, path,
- svn_wc__props_base,
+ svn_wc__props_working,
                                             adm_access, pool));

        SVN_ERR(svn_wc__write_log(adm_access, 0, log_accum, pool));

Alexander Sinyushkin,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Nov 1 19:33:51 2007

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.