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

Data Lifetimes

From: Skip Hodgson <shodgson_at_stvincents.com.au>
Date: 2007-01-30 08:25:39 CET

I am having trouble deciding whether I am looking at a bug or a personal
misunderstanding regarding the visibility of deleted branches. Here is
a little test script which reveals my dilemma.

In the Collins-Sussman Book Chapter 4 - Data Lifetimes we read:

"And now your branch is gone. Of course it's not really gone: the
directory is simply missing from the HEAD revision, no longer
distracting anyone. If you use svn checkout, svn switch, or svn list to
examine an earlier revision, you'll still be able to see your old
branch."

When I run this script against my Subversion 1.4.2 server (which is
using Apache 2.2.3) it appears that the statement that svn list will
reveal the old branch is not correct!

Where am I going wrong?

Skip

------- BEGIN TEST SCRIPT -----
#! /bin/sh

# some working space
start=/tmp

# Our instance of a Subversion Repository
base=http://localhost/svn/skip_project

# Clean up before we start testing
svn delete $base/myjunk -m "x"
rm -rf $start/project

cd $start

mkdir project
cd project
mkdir myjunk
mkdir myjunk/trunk
mkdir myjunk/branches
mkdir myjunk/tags
echo hello > myjunk/trunk/testing

echo initializing project
svn import $start/project $base -m "testing delete"
rm -rf $start/project

echo Latest text is:
svn cat -r HEAD $base/myjunk/trunk/testing

svn copy $base/myjunk/trunk $base/myjunk/branches/v2 -m "x2"
latest=`svn info $base/myjunk |grep Revision|awk '{print $2}'`

echo latest Revision is $latest and contains:
svn list -r $latest $base/myjunk/branches/v2
svn cat -r $latest $base/myjunk/branches/v2/testing

echo Now deleting branch/v2
svn delete $base/myjunk/branches/v2 -m "x3"

# Here we try to print out the old revision of the file we have deleted
# svn will fail to find the old revision
echo Try printing out the deleted revision - number $latest
svn list -r $latest $base/myjunk/branches/v2
svn cat -r $latest $base/myjunk/branches/v2/testing

# It is not really gone though because we can restore a copy of it!!
echo Restore a copy
svn copy -r $latest $base/myjunk/branches/v2 $base/myjunk/branches/v2 -m
"x4"

# Even though the restored copy has a different revision number - now we
can see the previously invisible revision
echo Try printing out revision $latest
svn list -r $latest $base/myjunk/branches/v2
svn cat -r $latest $base/myjunk/branches/v2/testing

----END TEST SCRIPT------

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been virus
scanned and although no viruses were detected by the system, St Vincents &
Mater Health Sydney accepts no liability for any consequential damage
resulting from email containing any computer viruses.

**********************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Jan 30 08:32:58 2007

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.