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

Re: Working copy 'from the future' after restoring server from old backup (was "Huge Problem")

From: B Smith-Mannschott <bsmith.occs_at_gmail.com>
Date: Sun, 6 Jun 2010 22:30:17 +0200

On Sun, Jun 6, 2010 at 21:43, Abius X <abiusx_at_gmail.com> wrote:
> Hi
> thanks for the quick response,
> Actually I'm on OS X Snow Leopard (10.6.3) and
> I'm using Eclipse and Subversive (or Subclipse whichever is bundled with Eclipse)
>
> I'm partially familiar with diff, but my project folder is quite huge!
>
> So I just create another Working Copy, apply the changes to it and commit?
>
> what if there are many folders added? I even have many branches added since then!
>
> I'd appreciate your help again
> Kind Regards
>

Does your working copy include branches?

But, you are on OS X, which helps things a bit. It's past my bedtime,
however, which doesn't help things. I'll sketch what I would do:

0. make a backup copy of your old working copy before continuing

cp -R project-old project-old.backup

1. check out a working copy from your restored repository. I'm going
to assume it's of at least a whole project, so it contains branches,
tags and a trunk.

svn co http://svn.example.com/repo/project project-new

2. if there are branches (or tags) in project-old that don't exist in
project-new, recreate those in project-new by (for example) copying
from trunk:

svn copy project-new/trunk project-new/branches/some-branch-name
...

3. check that stuff in. you'll at least have the right branches, even
if they have the wrong content.

svn commit -m "restored missing branches (with wrong content)" project-new

4. incorporate the changes from your old working copy into the new working copy.

rsync -r --del -c --exclude=.svn project-old/ project-new

## the trailing slash in "project-old/" is significant!

5. svn status may reveal missing (!) files or unknown (?) files.

We need to tell svn that the missing ones are deleted and the unknown
ones are to be added. I'd do it like this:

cd project-new
svn status | egrep "^[!]" | cut -c9- | tr '\n' '\0' | xargs -0 svn rm
svn status | egrep "^[?]" | cut -c9- | tr '\n' '\0' | xargs -0 svn add

6. examine the results with svn status and svn diff.
   svn commit when you are happy with te results.

// Ben
Received on 2010-06-06 22:30:56 CEST

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.