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

'svn cp wc URL' bug

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2004-12-04 15:38:05 CET

I've had a long-standing beef with 'svn cp wc URL'. Specifically, I
see users invoking this techique as a way to make a quick snapshot of
the working copy. Then I see complaints about how the tag "resurrects"
files that the user had already deleted.

'svn cp wc URL' builds a repos transaction by walking over the
mixed-revs in the working copy; but my suspicion is that it doesn't
report 'deleted' files as missing in the transaction (which is what we
do in updates).

I've long insisted that there was a bug here, and now I have a script
to prove it!

Anyone mind if I file this?

--------------------------------------

#!/bin/sh

rm -rf repos wc
svnadmin create repos
svn co file://`pwd`/repos wc

# Add two files
cd wc
touch file1; touch file2
svn add file1; svn add file2
svn commit -m "Add two files and tags dir".

# Put wc at revision 1.
svn up

# Delete file1.
svn rm file1
svn commit -m "Delete file1."

# Change file2.
echo "blah" >> file2.
svn ci -m "Change file2".

# Change file2 again.
echo "blah again" >> file2

# "Gee whiz, I want to make a snapshot of my wc."
# User is ignorant that wc is still at r1 with a 'deleted' file1 entry.
cd ..
svn cp wc file://`pwd`/repos/sometag -m "Tag my wc"

# Now checkout the tag.
svn co file://`pwd`/repos/sometag tagwc

# Hey, look at that! My tag has 'file1' in it!
# But I thought I deleted that file... it wasn't in my wc when I tagged!

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Dec 4 15:40:17 2004

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.