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

Re: Problems accessing a deleted file

From: <kfogel_at_collab.net>
Date: 2005-12-19 17:41:36 CET

Paul Koning <pkoning@equallogic.com> writes:
> I'm working on a post-commit script. I'm running into some trouble
> with deletions.
>
> The scenario goes like this:
>
> file foo was copied from trunk to a branch at rev 34995
> file foo was then deleted on the branch at rev 36201
>
> Normally I would expect
> svn cat -r 36200 branch/mybranch/foo@36200
> to work (and give me the file as it was just before the deletion).
>
> In this case, it doesn't work, and in fact I see other oddities.
>
> svn log branch/mybranch/foo@36200 fails
> svn log branch/mybranch/foo@34995 fails
> svn log -r 34995 branch/mybranch/foo@34995 fails
> svn cat branch/mybranch/foo@34995 works
>
> The failures look like this (this one is for the third example above):
>
> svn: File not found: revision 34995, path '/branches/Portwood_patches/NetBSD162/src/EQL/windows/src/user/snmp/include/eqltunnel.h@34995'
>
> It seems to me all this *should* work, right?
>
> This is Subversion 1.2.3, fsfs repository, Linux, file: style URLs.

Well, both 'cat' invocations worked for me using r17850 of trunk
(today's HEAD). See the reproduction script below. As for the 'svn
log' problems, see

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

which says that peg revs apparently don't work with 'svn log' :-(.

Here's the script I used:

#!/bin/sh

SVN=${HOME}/src/subversion/subversion/svn/svn
SVNADMIN=${HOME}/src/subversion/subversion/svnadmin/svnadmin

# URL=http://localhost/SOMETHING/repos
# URL=svn://localhost/SOMETHING/repos
URL=file:///`pwd`/repos

rm -rf repos wc

${SVNADMIN} create repos
${SVN} co ${URL}/ wc

# This is an attempt to reproduce a bug reported by Paul Konig.
# Here's his reproduction recipe:
#
# PK: file foo was copied from trunk to a branch at rev 34995
# PK: file foo was then deleted on the branch at rev 36201
# PK:
# PK: Normally I would expect
# PK: svn cat -r 36200 branch/mybranch/foo@36200
# PK: to work (and give me the file as it was just before the deletion).
# PK:
# PK: In this case, it doesn't work, and in fact I see other oddities.
# PK:
# PK: svn log branch/mybranch/foo@36200 fails
# PK: svn log branch/mybranch/foo@34995 fails
# PK: svn log -r 34995 branch/mybranch/foo@34995 fails
# PK: svn cat branch/mybranch/foo@34995 works
# PK:
# PK: The failures look like this (this one is for the third example above):
# PK:
# PK: svn: File not found: revision 34995, path \
# PK: '/branches/Portwood_patches/NetBSD162/src/EQL/ \
# PK: windows/src/user/snmp/include/eqltunnel.h@34995'
# PK:
# PK: It seems to me all this *should* work, right?
# PK:
# PK: This is Subversion 1.2.3, fsfs repository, Linux, file: style URLs.
#
# Now here's our attempt to reproduce, using smaller revision numbers
# of course:

${SVN} mkdir -m "Create trunk directory in, r1." ${URL}/trunk
${SVN} mkdir -m "Create branches directory, in r2." ${URL}/branches
${SVN} mkdir -m "Create tags directory, in r3." ${URL}/tags

# Make 'mybranch'.
${SVN} mkdir -m "Create mybranch, in r4." ${URL}/branches/mybranch

cd wc
${SVN} up
echo "This is a file." > trunk/file.txt
${SVN} add trunk/file.txt
${SVN} ci -m "Add file.txt, in r5."
${SVN} up # just for kicks

# Now copy the file from trunk to branch, using URLs.
${SVN} cp -m "Copy file.txt from trunk to branch, in r6." \
       ${URL}/trunk/file.txt ${URL}/branches/mybranch/file.txt

# Get an up-to-date copy of everything, including the branch.
${SVN} up

# Make some stuff happen to the file on the branch, before deleting it.
echo "Some more text, on the branch." >> branches/mybranch/file.txt
${SVN} ci -m "Add some text to branches/mybranch/file.txt, in r7."
echo "Yet more text, also on the branch." >> branches/mybranch/file.txt
${SVN} ci -m "Add yet more text to branches/mybranch/file.txt, in r8."

# Delete the file from the branch in the next revision.
${SVN} rm -m "Remove file.txt from the branch in r9." \
       ${URL}/branches/mybranch/file.txt

# Our history corresponds to PK's like so:
# r6 ==> PK's r34995
# r8 ==> PK's r36200
# r9 ==> PK's r36201
#
# Now we try PK's various ways of accessing the deleted file.

echo "******** cat -r8 PATH@8 fails for PK, but should work:"
${SVN} cat -r8 ${URL}/branches/mybranch/file.txt@8
echo ""

echo "******** log PATH@8 fails, see issue #2460 for why:"
${SVN} log ${URL}/branches/mybranch/file.txt@8
echo ""

echo "******** log PATH@6 fails, see issue #2460 for why:"
${SVN} log ${URL}/branches/mybranch/file.txt@6
echo ""

echo "******** log -r6 PATH@6 fails, see issue #2460 for why:"
${SVN} log -r 6 ${URL}/branches/mybranch/file.txt@6
echo ""

echo "******** cat PATH@6 works for PK, and should work:"
${SVN} cat ${URL}/branches/mybranch/file.txt@6
echo ""

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Dec 19 19:34:53 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.