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

how to corrupt the working copy

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: 2006-03-25 10:52:46 CET

Hi,

Attached is a recipe on how to get a corrupt working copy, doing only
updates.
Basically, it happens if you try to update your working copy, but have
one file 'locked' by another application so that subversion can't write
to that file.
(with version 1.3.0)

@echo off
set ROOT=D:/test
set REPONAME=lockrepo
set WCNAME=lock
set REPO=file:///%ROOT%/%REPONAME%
set WC=%ROOT%/%WCNAME%

cd %ROOT%
if exist %REPONAME% rd /s /q %REPONAME%
if exist %WCNAME% rd /s /q %WCNAME%
if exist %WCNAME%2 rd /s /q %WCNAME%2

mkdir %REPONAME%
svnadmin create %REPONAME%
mkdir %WCNAME%
cd %WCNAME%
echo file1 > file1
echo file2 > file2
cd ..
svn import %WCNAME% %REPO% -m ""
rd /s /q %WCNAME%
svn co %REPO% %WCNAME%
svn co %REPO% %WCNAME%2
echo test > %WCNAME%\file1
echo test > %WCNAME%\file2
svn ci %WCNAME% -m ""
echo
echo now open the file in %WCNAME%2\file2 exclusively, so Subversion
can't write to it.
:: important: you must open file2 here. With file1, everything would be
fine.
pause
svn up %WCNAME%2
echo
echo now close the file %WCNAME%2\file2.
pause
svn up %WCNAME%2
svn cleanup %WCNAME%2

Now, when executing 'svn cleanup' as suggested by the 'svn update',
you'll get:
svn: In directory 'lock2'
svn: Can't copy 'lock2\.svn\tmp\text-base\file1.svn-base' to
'lock2\file1.2.tmp' : the system can't find the specified file.

Frome here, there's no way to recover the working copy without digging
into the .svn folder (which I always tell users to *never* do).

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Mar 25 10:53:07 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.