[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to restore removed branch
From: |
Eric Siegerman |
Subject: |
Re: how to restore removed branch |
Date: |
Mon, 27 May 2002 13:31:16 -0400 |
User-agent: |
Mutt/1.2.5i |
On Fri, May 24, 2002 at 09:36:19AM -0400, Yan, Rong (R.) wrote:
> I made a mistake yesterday: when I tried to remove a branch from
> a file under certain dirctory, I did it under graph mode. So CVS removed
> this branch from every file under this directory. This branch is the
> main branch for our project. We have to restore it to every file under
> this directory and keep the original revision history.
If you're *very* lucky, there might be a branch-point tag that
was created at the same time the branch itself was created. If
that's the case, you can recreate the branch tag based on the
branch-point tag.
Otherwise, there's no easy way to do this. One possibility is to
just restore the repo from a backup, and redo whatever changes
have been committed since then. If that's unacceptable, your
best bet is to:
- Restore the repository from a backup, to a temporary
location, NOT over-top of the live repository.
- From the temporary copy, get a list of all the files, and the
revision numbers of the branch tag for the branch in question.
If you have a recent version of CVS, you can use
cvs -d <temporary_repository_copy> rlog <module>
Otherwise, use "rlog" if you have it; or check out a working
directory from the temporary copy, cd into it, and use "cvs
log".
- Turn that list into a shell/Perl/whatever script that will
restore the branch tag to the correct revision for each file.
You might be able to figure out the correct revisions yourself,
one file at a time -- but only if the directory is small. If it
contains more than a few files, this will be long, slow, and
tedious; and you're very likely to make mistakes.
Whatever you do, BACK UP the repository just before you try to
make the repairs, to protect you against further mistakes.
> This is an example of the our file with correct history graph inside CVS:
>
> <<...OLE_Obj...>>
As an aside, it doesn't work to copy and paste stuff that isn't
text into email that goes outside your company's local M$ mail
environment.
--
| | /\
|-_|/ > Eric Siegerman, Toronto, Ont. address@hidden
| | /
Anyone who swims with the current will reach the big music steamship;
whoever swims against the current will perhaps reach the source.
- Paul Schneider-Esleben