You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Joey Hess <jo...@kitenet.net> on 2003/11/23 17:35:24 UTC

how to revive a deleted directory? (+ svn segfault)

I have used cvs2svn to convert a peice of a repository that was all in
the CVS attic, over to subversion. I didn't omit the last change, which
deleted all the files. Now I want to somehow put the deleted files back
in subversion head. How can I do this?

Here's the first thing I tried:

joey@kite:~>svn cp -r PREV file:///svn/joey/flashybrid-trunk file:///svn/joey/foo
svn: A path under revision control is needed for this operation
svn: svn_client__get_revision_number: need a version-controlled path to fetch local revision info.

I tried checking out the base of my repository, and do a svn cp from
PREV, but it fails miserably:

joey@kite:~/tmp>svn co  -N file:///svn/joey/
A  joey/README
joey@kite:~/tmp/joey>svn cp -r PREV flashybrid-trunk foo
zsh: segmentation fault  svn cp -r PREV flashybrid-trunk foo

I'm not sure if this is because I did a non-recursive checkout (full
checkout is some 3 gb). I tried a slightly larger partial checkout and
it also segfaults there.

I'm using subversion 0.32.1-1 from debian unstable.

-- 
see shy jo

Re: how to revive a deleted directory? (+ svn segfault)

Posted by Joey Hess <jo...@kitenet.net>.
Following up on myself, it looks like the problem is the -r PREV. If I
give it an explicit revision, it works fine, even without a WC:

joey@kite:~/tmp>svn cp -r 5056 file:///svn/joey/flashybrid-trunk file:///svn/joey/trunk/src/flashybrid -m 'move from cvs2svn conversion, revive from cvs attic'
Committed revision 5058.

-- 
see shy jo

Re: how to revive a deleted directory? (+ svn segfault)

Posted by Joey Hess <jo...@kitenet.net>.
Thanks for clarifying PREV, I obviously need to re-read the book.

Julian Foad wrote:
> That's interesting.  I don't get a segfault when I try to do a similar 
> thing, but then I'm running the head version of Subversion, and the 
> segfault bug might have been fixed already.
> 
> ~/tmp> svn co -N file:///home/julianfoad/vcs/sandbox/
> A  sandbox/eol-test
> A  sandbox/f
> A  sandbox/gnudiff
> A  sandbox/space in name
> A  sandbox/t
> A  sandbox/x
> Checked out revision 47.
> ~/tmp> cd sandbox/
> ~/tmp/sandbox> svn cp -r PREV cyc foo
> svn: Tried a versioning operation on an unversioned resource
> svn: 'cyc' is not under version control
> 
> In my case, "cyc" is a directory that existed in the repository up to 
> revision 46 but was deleted in revision 47 (HEAD).  I am assuming that 
> this corresponds to your scenario.

Yes, that looks very similar.

I cannot try the new version of subversion just yet, but I can probably
make the (very small) repository and a full transcript of a reproduction
of the bug available to anyone who's interested.

-- 
see shy jo

Re: how to revive a deleted directory? (+ svn segfault)

Posted by Julian Foad <ju...@btopenworld.com>.
Joey Hess wrote:
> 
> joey@kite:~>svn cp -r PREV file:///svn/joey/flashybrid-trunk file:///svn/joey/foo
> svn: A path under revision control is needed for this operation
> svn: svn_client__get_revision_number: need a version-controlled path to fetch local revision info.

This error message is produced because "PREV" means the revision before your working copy's base revision.  It doesn't mean the revision before HEAD.  "PREV" and "BASE" can only be used when there is a working copy for them to refer to.


> I tried checking out the base of my repository, and do a svn cp from
> PREV, but it fails miserably:
> 
> joey@kite:~/tmp>svn co  -N file:///svn/joey/
> A  joey/README
> joey@kite:~/tmp/joey>svn cp -r PREV flashybrid-trunk foo
> zsh: segmentation fault  svn cp -r PREV flashybrid-trunk foo

That's interesting.  I don't get a segfault when I try to do a similar thing, but then I'm running the head version of Subversion, and the segfault bug might have been fixed already.

~/tmp> svn co -N file:///home/julianfoad/vcs/sandbox/
A  sandbox/eol-test
A  sandbox/f
A  sandbox/gnudiff
A  sandbox/space in name
A  sandbox/t
A  sandbox/x
Checked out revision 47.
~/tmp> cd sandbox/
~/tmp/sandbox> svn cp -r PREV cyc foo
svn: Tried a versioning operation on an unversioned resource
svn: 'cyc' is not under version control

In my case, "cyc" is a directory that existed in the repository up to revision 46 but was deleted in revision 47 (HEAD).  I am assuming that this corresponds to your scenario.

Nevertheless, I think there might be a bug in non-recursive checkouts.  After the checkout, if I run "svn status -u" I expect to see the directory names (that are in the repository but not checked out) listed with a "*", but I don't see them at all.  

I can't find a way to get such a directory back into the WC except with "merge" like Erik suggested.  I think "copy" ought to work too.

I am posting to the development mailing list about this, with the subject "Non-recursive checkout is broken?"

- Julian


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: how to revive a deleted directory? (+ svn segfault)

Posted by Erik Huelsmann <e....@gmx.net>.
Joey,

If you want to undo all changes from the HEAD revision made in the last
commit, you could do that like this:

 $ svn update
(now your working copy is at HEAD)

 $ svn merge -r BASE:PREV URL-to-repository

That way you merge the difference between HEAD and PREV into your working
copy. The trick is to reverse the order of the revisions: latest first and
earliest last. 

HTH,

Erik.

> I have used cvs2svn to convert a peice of a repository that was all in
> the CVS attic, over to subversion. I didn't omit the last change, which
> deleted all the files. Now I want to somehow put the deleted files back
> in subversion head. How can I do this?

-- 
NEU F�R ALLE - GMX MediaCenter - f�r Fotos, Musik, Dateien...
Fotoalbum, File Sharing, MMS, Multimedia-Gru�, GMX FotoService

Jetzt kostenlos anmelden unter http://www.gmx.net

+++ GMX - die erste Adresse f�r Mail, Message, More! +++


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org