[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How I repaired my repository
From: |
Mike Ayers |
Subject: |
How I repaired my repository |
Date: |
Tue, 30 Jul 2002 11:11:37 -0700 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.0) Gecko/20020530 |
[Note: this is an update. There were two steps I forgot]
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. Now step through your archives and find all the directories which
do not exist in the restored repository and should.
I do not know how to do this on the command line, as I am using
WinCVS, which makes this step quite easy.
9. Add any files in the directories discovered in Step 8 to
the restored repository.
10. 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.
11. 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.