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

bug in Subversion, or do I have unreasonable expectations?

From: Mike Linda <Mike.Linda_at_gsfc.nasa.gov>
Date: 2005-09-13 02:03:56 CEST

Dear Subversion Community,

I ran into a problem with Subversion and I am wondering if it is a new bug,
or just a loose nut on the keyboard...

When I try to checkout a directory (subset) of an older version, and that
directory is not a member of the latest version, then I get this error:

  svn: File not found: revision xxx, path '/yyy'

    (where "xxx" is the latest version, not the one I am trying to access,
    and "yyy" is the path of the directory in question)

I read the FAQs and bug reports at subversion.tigris.org and there are a
couple of similar items there, but nothing exactly like what I ran into.

When I try to checkout the whole (older) version, all works fine.

When I use @PEGREV at the end of the path, it also checks out the older
version subset -- although I read somewhere that this was a workaround.

And, of course, when I checkout the entire older version (not just a
subset), then it works fine.

Export (mis)behaves same in this case as checkout.

It would seem to me that I should be able to checkout a subset of an older
version -- a sub-version (this being Subversion and all).

I saw this FAQ:
   http://subversion.tigris.org/faq.html#no-copy-history

   ...but in my case no copying or renaming is involved. I am simply
removing a directory, but once in a while I need to get the older version
that still has the directory.

I saw this bug...
   http://subversion.tigris.org/issues/show_bug.cgi?id=2163

   ...but that has a different error message and involves moving
directories around, which is not my case.

We're using SVN version 1.2.0 on a Red Hat Linux system:

  Linux version 2.4.21-32.0.1.EL (bhcompile@bugs.build.redhat.com)
  (gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-52)) #1 Tue May 17
  18:01:37 EDT 2005

Any ideas? Is this a bug (old or new), or am I expecting too much?

--Mike

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

Here is output of a test script that illustrates the problem (with the
script further below):

+ rep=/tmp/test
+ q=
+ cd /home/mlinda
+ rm -fr /home/mlinda/tmp /tmp/test
+ mkdir -p /tmp/test
+ svnadmin create --fs-type fsfs /tmp/test
+ tmp=/home/mlinda/tmp
+ mkdir -p /home/mlinda/tmp
+ cd /home/mlinda/tmp
+ svn co file:///tmp/test
Checked out revision 0.
+ cd /home/mlinda/tmp/test
+ mkdir -p dir1 dir2
+ svn add dir1 dir2
A dir1
A dir2
+ date
+ date
+ svn add dir1/fileA
A dir1/fileA
+ svn add dir2/fileB
A dir2/fileB
+ svn ci -m 'first version'
Adding dir1
Adding dir1/fileA
Adding dir2
Adding dir2/fileB
Transmitting file data ..
Committed revision 1.
+ cd /home/mlinda/tmp/test
+ svn rm dir1
D dir1/fileA
D dir1
+ svn ci -m 'second version'
Deleting dir1

Committed revision 2.
+ cd /home/mlinda/tmp
+ rm -fr test
+ cd /home/mlinda/tmp
+ svn co -r1 file:///tmp/test/dir2
A dir2/fileB
Checked out revision 1.
+ cd /home/mlinda/tmp
+ echo ' '
  
+ echo 'This next command will give an error message.'
This next command will give an error message.
+ echo 'On my system, the message is this:'
On my system, the message is this:
+ echo 'svn: File not found: revision 2, path '\''/dir1'\'''
svn: File not found: revision 2, path '/dir1'
+ echo ' '
  
+ svn co -r1 file:///tmp/test/dir1
svn: File not found: revision 2, path '/dir1'
+ cd /home/mlinda/tmp
+ svn co -r1 file:///tmp/test/dir1_at_1
A dir1@1/fileA
Checked out revision 1.
+ cd /home/mlinda/tmp
+ svn co -r1 file:///tmp/test
A test/dir1
A test/dir1/fileA
A test/dir2
A test/dir2/fileB
Checked out revision 1.
+ echo ' '
  
+ echo 'To clean up, execute these commands:'
To clean up, execute these commands:
+ echo ' cd ~'
  cd ~
+ echo ' rm -fr ~/tmp /tmp/test'
  rm -fr ~/tmp /tmp/test
+ echo ' '
  
----------------------------------------------------------------------

Here is a test script for illustrating this condition. Change "q=" to
"q=-q" to see less distractions:

#!/bin/sh
#
# SVN cannot checkout (or export) a directory of an older
# version when that directory does not exist in the current
# version.
#
# Mike.Linda@gsfc.nasa.gov
# 12 September 2005

# 1. Clean up from any previous runs of this script:

   rep=/tmp/test
   q=
# q=-q

   cd ~
   rm -fr ~/tmp $rep

# 2. Create an empty SVN repository (under /tmp) called "test":

   mkdir -p $rep
   svnadmin create --fs-type fsfs $rep

# 3. Toward version 1, add some files into subdirectories:

   tmp=~/tmp
   mkdir -p $tmp
   cd $tmp
   svn co $q file://$rep
   cd $tmp/test

   mkdir -p dir1 dir2
   svn add $q dir1 dir2

   date > dir1/fileA
   date > dir2/fileB

# 4. Add new directories and files to the repository,
# creating version 1:

   svn add $q dir1/fileA
   svn add $q dir2/fileB
   svn ci $q -m 'first version'

# 5. Remove one of the directories with all files,
# creating version 2:

   cd $tmp/test
   svn rm $q dir1
   svn ci $q -m 'second version'

# 6. Clean up:

   cd $tmp
   rm -fr test

# 7. Check out of version 1 a part that also exists in
# version 2 (this works fine):

   cd $tmp
   svn co $q -r1 file://$rep/dir2

# 8. Try to check out of version 1 a part that is a member of
# version 1, but that no longer exists in version 2 (this
# gives errors):

   cd $tmp
   echo " "
   echo "This next command will give an error message."
   echo "On my system, the message is this:"
   echo "svn: File not found: revision 2, path '/dir1'"
   echo " "
   svn co $q -r1 file://$rep/dir1

# 9. Note that the same happens with "svn export -r1 ..."

# 10. Note that this works (maybe similar to bug
# http://subversion.tigris.org/issues/show_bug.cgi?id=2163):

   cd $tmp
   svn co $q -r1 file://$rep/dir1_at_1

# 11. Note that checking out the whole version 1 also works OK:

   cd $tmp
   svn co $q -r1 file://$rep

# 12. Clean up after the test:

    echo " "
    echo "To clean up, execute these commands:"
    echo " cd ~"
    echo " rm -fr ~/tmp /tmp/test"
    echo " "

# end of script

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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Sep 13 02:54:55 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.