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

Re: svn update failed

From: Ryan Schmidt <subversion-2008a_at_ryandesign.com>
Date: Wed, 19 Mar 2008 02:50:57 -0500

On Mar 19, 2008, at 01:17, Ding Honghui wrote:

> Assume 2 developer, User A and User B.
> initial svn source struct as like that
>
> svntest/
> `-- dir
> |-- a
> | `-- file
> |-- b
> | `-- file
> `-- c
> `-- file
>
> 4 directories, 3 files
>
> User A check out the svntest and make some modify on it.
>
> - add a file in directory a
> - remove the file in directory b
> - modify the file in directory c
>
> and not commit it.
>
> User B remove the directory dir from svn repos by mistake,
> then, User B check out the initial rev of svn and add the dir to
> current
> version to recover it.
>
> Then, when the User A try to svn update, it failed.
>
> What should User A do in this condition?
>
> http://218.108.10.40/buildsvn.sh construct the condition above.

 From your script:

> svn co -r1 file://$SVNROOT/svntest/
> mv svntest/dir .
> rm -rf svntest
>
> echo find dir -name .svn -exec rm -rf {} \;
> find dir -name .svn | xargs rm -rf
>
> svn co file://$SVNROOT/svntest/
> mv dir svntest
> cd svntest
> svn add dir
> svn ci -m "recover from orignal version"
> echo work space for user is: $WORKSPACE
> echo the svn repos is: file:///$SVNROOT
> echo rm -rf $WORKSPACE $SVNROOT after you finished it.

That's not how you would resurrect the deleted directory. There are
many problems with doing it this way: 1) it's a lot of steps; 2) it
loses the history of deletion and everything before that; 3) it re-
uploads all the files into the repository instead of cheaply copying
them from the previous revision where they already existed; 4) it
causes the error you observed.

The correct way to resurrect it is:

svn cp file://$SVNROOT/svntest/dir_at_1 file://$SVNROOT/svntest -m
"resurrect dir from r1"

Or you could also undo revision 2 as per the book:

http://svnbook.red-bean.com/en/1.4/
svn.branchmerge.commonuses.html#svn.branchmerge.commonuses.undo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-03-19 09:11:54 CET

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.