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

Workable workarea after restoring repository

From: Chris Dailey <mouse_at_intranet.org>
Date: Sun, 15 Mar 2009 17:45:23 -0600

The drive our repository was on went down. We were able to successfully
restore it from a backup 1.5 days ago. However, the workareas are now
unusable. Any attempt to do anything with them results in the message
"Error No such revision 35225", which is the last revision I had updated
to. The maximum version in our restored repository is 35203. So there is
a 22 revision difference between my workarea and the restored
repositories. We have a couple handfuls of others with workareas that
have the same problem, although they would be updated at different
times. I presume everyone that last updated before version 35203 will be
fine.

The question is ... how do I get the other workareas working, and how do
I get their lost changes (which are in their existing workareas) into
the restored repository?

I would have liked to have simply had a command that would take the
workarea .svn files back to 35103. Then the workarea files would still
be there, but would show up as "modified". The individual people could
then just check in their files after looking at them. However, this
command does not exist to the best of my knowledge.

I was surprised that there was no guidance in the documentation. This
seems like a crucial use case, especially as the number of users and the
time since last backup goes up. I would suggest it for a future
addition! (Perhaps a variant of what I found below?)

I did some Googling and did not find a satisfactory solution. I tried
all sorts of tricks to get the local workarea to travel back to the
restored version, but there was no direct way of doing it.

So here is my solution. The instructions are a bit TortoiseSVN and
Windows specific, but you should be able to easily generalize them to
any SVN client.

1. Back up your changes.
Copy your current SVN workarea folders to a temporary backup location.
This is just in case anything goes wrong.

2. Create a new working workarea.
Check out the directories from the repository to a new temporary
location. The easiest way to do this is to start up the TortoiseSVN
Repo-Browser from your existing SVN tree, choose the folder in the
repository you want to check out, select a new folder on disk
(suggestion: for /Source in SVN, use C:\svnrestore\Source), and then
check it out there.

3. Copy/Export changed files from your original workarea into the new
working workarea.
The next step involves copying all of your working files from the
original workarea into the newly checked out Subversion tree. Using
Export, it will only copy the workarea version of files that had been
added to Subversion (including your changes!). Export will not copy the
internal SVN files (e.g. _svn or .svn folders), or files such as .OBJ
and .EXE files that are generated by the IDE.
a. Go to the top folder of your old subversion workarea, choose
“Export…” from the Subversion menu
b. Don’t select any of the check boxes
c. Navigate to the temporary location. Choose the folder above where you
want to copy to; for example, if you want to export C:\svn\Source to
C:\svnrestore\Source, choose C:\svnrestore as the destination folder.
Accept the dialog.
d. Overwrite? [Yes to All]
e. Double-check when it starts to be sure that the destination location
is what you are expecting.
The newly checked out workarea will now the SVN changes that were in
your original workarea.

4. Examine changes in the new working workarea and commit/check in yours.
In the newly checked out version of the Subversion tree, you will be
able to easily find files that were changed since the last backup. Find
each file that has changed. If it was your change, make sure it is
correct and check it in (commit it) if it is ready. BE SURE TO
COORDINATE WITH OTHER PEOPLE MAKING CHANGES. If it is someone else’s
change or their changes are mixed with yours, talk with them to resolve
the changes.

5. Copy new working workarea over your original workarea.
Once all of your changes are checked in, an additional step will make
your original tree work. This involves copying the newly checked out
version over the original tree you had. (This is why we made a backup in
step #1, just in case something goes wrong in this step.) If you use
Windows Explorer to do the copy, say Yes to overwriting files, and Yes
to overwriting read-only permissions.

If you prefer command-line, xcopy also works. Here is an example:
xcopy c:\svnrestore\Source C:\svn\Source /s /e /x /h /r /y

At this point, your original tree should now be updated so you can work
normally. You may have some conflicts during the day with other files
being checked in by other groups, but you will have to deal with these
as they happen. The easiest way may be to revert those files, assuming
you have no changes.

I hope others might find this of use.

Chris

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=1329869

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2009-03-16 07:03:38 CET

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

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