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

Re: Utilities available to repair working copies? Checking before I write one.

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Fri, 13 Feb 2009 07:38:04 +0100

K. Kaland wrote:
> I started using a program called PowerFolder recently; it's a
> synchronization program. Unfortunately, a combination of me allowing
> it to delete empty directories and a bug in the program resulted in
> havoc being wreaked on my SVN directories and a few of my files.
>
> I have been able to recover, for all intents and purposes, by dragging
> copies back out of the Repository Explorer where the files had been
> removed, and they were picked up again in their correct state
> (modified, up-to-date, whatever). However, these same files seem to be
> lacking corresponding .svn-base files in the .svn\text-base folder,
> invariably. Restoring all of these manually would be a nightmare, and
> I still have another repository to recover.
>
> The other thing that happened was that my .svn\tmp\entries files were
> pretty much all wiped. I found that by simply creating an empty
> entries file in a \tmp directory, I could fix this.
>
> Overall, my recovery method has been effective, but very slow to do
> manually. I am planning to write a simple program in Visual C# .NET
> 2008 to basically do what I've been doing (for now, I've just been
> committing the most important files directly to avoid errors):
>
> 1. Iterate recursively through each versioned directory (meaning
> a .svn subdirectory exists).
> 2. If the .svn directory has no child tmp directory, create one, and
> write a file called entries in text mode into that directory (or just
> copy a pre-made skeleton tmp directory with an entries file inside of
> it into the .svn directory)
> 3. Build a list of the files in text-base without their .svn-base
> extensions.
> 4. Compare this list to the list of files in the directory that
> the .svn directory is governing and build a list of those that have no
> corresponding .svn-base entry.
> 5. Copy the files with no .svn-base entry into .svn\text-base. These
> files will generally be ones that were copied from the repo-browser,
> so this should be valid.
>
> Then I will manually run a Cleanup after all is said and done, and it
> should work, I should be able to update and hopefully get to a good
> state and then commit anything I need to.
>
> Does anyone see loopholes or omissions in my logic? It seems like
> it'll work to me, even though it's kinda hoakey, and maybe that's why
> I can't find a utility for it on the Internet. Or maybe there is a
> better way. I don't want to do a fresh checkout because I'll lose my
> modified files (modified in comparison to the repo). I've already
> unversioned several directories, and I know SVN is going to complain
> when I try to add them back, and I'll have to do some housekeeping on
> the repository again. But that should be manageable manually, cuz I'm
> not bold enough to try touching anything in the repository itself!

Just check out a fresh working copy!
You'll get into much, MUCH worse trouble with your repair script -
guaranteed.

Because:
* you simply assume that the .base entries are the same as your wc files
(_completely_ wrong!)
* ...

I could list up another three reasons why your script will mess up the
wc even more.

A fresh checkout is your only option. But: that doesn't mean you're
loosing your local mods. Just
* export your current working copy (or unversion it, see
here:http://tortoisesvn.net/node/343)
* check out a new wc
* copy all the files from the exported/unversioned original wc to the new wc
* get rid of the old wc

Stefan

-- 
       ___
  oo  // \\      "De Chelonian Mobile"
 (_,\/ \_/ \     TortoiseSVN
   \ \_/_\_/>    The coolest Interface to (Sub)Version Control
   /_/   \_\     http://tortoisesvn.net
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=1149285
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].

Received on 2009-02-13 07:38:15 CET

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.