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

Re: Undo folder delete

From: Ulrich Eckhardt <eckhardt_at_satorlaser.com>
Date: 2007-10-01 16:16:47 CEST

Note up front: please don't use the reply-to function in order to start a new
thread. This is also explained the mailing list guidelines.

On Monday 01 October 2007 16:01, Brian Erickson wrote:
> We had a medium sized disaster here last Friday and I'm wondering if
> there was a better way to recover from it...
>
> Our source tree has two folders in it \vme and \pcs. One of our users
> accidentally deleted the \pcs folder. He doesn't remember doing an svn
> delete but I'll just take it on faith that he did.

Huh? A simple 'svn log' on the repository should reveal whether that was the
case!

> However, I couldn't think of a graceful way to recover.

Undoing something is SVN basics and documented in the SVN book! In this case
you either do a reverse merge or you make a copy from an old revision in the
repository. However, and that is something which really frightens me, how
come a user actually deleted the dir in the first place and then checked this
in? Even if he accidentally deleted the dir, he should not have checked this
in!

> Here's what I did:
>
> Checkout revision 190 into d:\head
> Checkout revision 189 into d:\lastgood
> Removed all .svn folders from 'd:\lastgood\pcs' tree
> Xcopy /sdki d:\lastgood\pcs d:\head\pcs
> In d:\head folder: svn add pcs
> In d:\head folder svn commit
> Now revision 189 and 191 match so things seem to be okay.
>
> Was there a better way?

Yes, definitely, see above. The disadvantage of your solution is that for
Subversion, those files that you added are completely new files which it
doesn't know anything about. Any properties (linending style, keyword
replacement) that were set on the original files are lost or set to defaults
that way. Further, and that's something that is IMHO even worse, the whole
history of those files has been disconnected! Subversion simply doesn't know
that ../pcs at revision 191 has anything to do with ../pcs at revision 189.
If you need the whole history, you will have to resort to using "peg
revisions" in order to get at the deleted parts.

Uli

-- 
Sator Laser GmbH
Geschäftsführer: Ronald Boers, Amtsgericht Hamburg HR B62 932
**************************************************************************************
           Visit our website at <http://www.satorlaser.de/>
**************************************************************************************
Diese E-Mail einschließlich sämtlicher Anhänge ist nur für den Adressaten bestimmt und kann vertrauliche Informationen enthalten. Bitte benachrichtigen Sie den Absender umgehend, falls Sie nicht der beabsichtigte Empfänger sein sollten. Die E-Mail ist in diesem Fall zu löschen und darf weder gelesen, weitergeleitet, veröffentlicht oder anderweitig benutzt werden.
E-Mails können durch Dritte gelesen werden und Viren sowie nichtautorisierte Änderungen enthalten. Sator Laser GmbH ist für diese Folgen nicht verantwortlich.
**************************************************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Oct 1 16:19:45 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.