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

Re: working copy corruption when network connection lost

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2002-01-04 21:58:28 CET

Philip Martin <philip@codematters.co.uk> writes:

> Thus I think this is the solution is: the working copy update code
> should remove (totally or just from revision control) an added
> subdirectory if the update gets interrupted while creating the
> subdirectory.

Wow, thank you so much for analyzing this. I think the problem has a
deeper solution.

In a nutshell, the parent directory should never contain a pointer to
a newly-created directory until new directory is completely
"finished".

In this case of your bug, if you tried to re-update after a network
failure, this solution would cause the new directory to be re-added
from scratch; the only complaint you'd get is that such a directory
already exists -- which easy for the user to remove. No corruption,
just a simple obstruction to remove.

Yes, I see the intent to do this in the wc update editor
(libsvn_wc/get_editor.c). Look at add_directory() -- you'll see that
after creating a new directory, it adds a pointer in the parent's
entries file. This is wrong, I think. If you scoot down to the
close_directory() routine, you'll notice that there's an ancient
comment about placing the parental link there.

This fix shouldn't be too hard; close_directory() just needs to
figure out if the directory was either added or opened. If added,
make a link in the parent. And of course, don't forget to remove the
parental linkage in add_directory().

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:54 2006

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.