info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Repairing repository


From: Mike Ayers
Subject: Re: Repairing repository
Date: Tue, 30 Jul 2002 10:43:48 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.0) Gecko/20020530

Okay, here's how I restored my repository from a recent archive of the repository itself and a good working tree (sandbox). Thanks to all who responded - I couldn't have done it without you.

First, all work is done on copies of the archive and the sandbox. Whenever I made a mistake, I just erased my working copies and started over.

1. Copy the archive to the new[1] location. Call this the restored archive.

        2.  Copy the sandbox to a new location.  Call this the preserved 
sandbox.

2. In a new location, check out a sandbox from the archive. Call this the restored sandbox.

3. Delete everything from the restored sandbox that isn't a CVS admin file:

$ find . -type f | grep -v '/CVS/' | sed 's/^/\"/' | sed 's/$/\"/' | xargs rm

(the sed scripts enclose the filename in quotes to handle paths with spaces in them, which I had)

        4.  Delete everything from the preserved sandbox that is a CVS admin 
file:

$ find . -type d -name CVS | sed 's/^/\"/' | sed 's/$/\"/' | xargs rm -rf

        5.  Copy the preserved sandbox onto the restored sandbox:

$ cd /restored/sandbox
$ cp -R /preserved/sandbox/* .

6. Do a `cvs update` on the restored sandbox. This should reduce the differences to the files which are actually different, and mark those files commitable.

7. Check the commitable files to ensure that they look like the ones in the preserved sandbox.

8. Commit all the commitable files, using a comment which is the same for all of them, and which can be used to find them. Optionally, tag them as well.

9. Check out a new sandbox. Other than the loss of some tags and commit comments, you should have your original archive back. (Note: I put this step in because I found that the read-only bits on the files in the restored sandbox were inconsistent after the restoration).


That's it. This is basically the method suggested by Eric Siegerman with a few modifications. Hope it helps.


/|/|ike


[1] - Due to the nature of my archive failure, I could not restore my archive to its old location. It makes no difference, though.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]