[Top][All Lists]

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

Re: Restoring deleted revisions (was: Branch Numbers)

From: Jim Hyslop
Subject: Re: Restoring deleted revisions (was: Branch Numbers)
Date: Fri, 13 May 2005 16:21:27 -0400
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

Hridyesh Pant wrote:
Hi Jim,
I need ur help,some how i deleted 1.1 revision of some files.can i restore this 

The only way to actually delete a revision of a file is using the 'cvs admin -o' command. There is no way to undo that action, except by restoring the repository file from your daily tape backups.

For example: if i have 1.2 revision of these files , can i make 1.1 revision 
which is copy of 1.2 revision?
You could, but what would be the point?

Is there any cvs command to do this.
No. Unless revision 1.1 has critical information in it, I wouldn't worry about it.

If you feel you absolutely must have the revision 1.1 available, then here's what I suggest (others may have better ideas):

Before you do anything, back up your repository as it sits right now. That way, if any of the following steps screw up, you can simply restore from backup.

If and *ONLY* if you are sure there have been no check-ins, tags, or other modifications to the file since the revision got deleted, then simply restore the ,v file from your tape backup into the repository. Make sure nobody else is trying to access these files while the restore is in process (you can create two empty files, called 'readers' and 'writers', in the CVSROOT directory to lock everyone out of the repository temporarily; delete the files when done).

Otherwise, if there is any doubt, then restore the repository file *into a different location in the repository*, check out revision 1.1 of the file, copy it into the "good" working area, and check it in on a branch. It will not be revision 1.1, but at least it will be available for inspection.

As an example, suppose the file you want restored is big_project/main.c. Have the file restored to, say, $CVSROOT/temp_for_restore/big_project directory. Then issue the following commands:

cvs co big_project
cd big_project
cvs tag -b -r1.2 revision_1_1 main.c
cvs up -r revision_1_1
cd ..
cvs co temp_for_restore/big_project/main.c
cp temp_for_restore/big_project/main.c big_project
cd big_project
cvs ci -m "Revision 1.1 restored from tape backup" main.c

Right now i am not able to send mail to "address@hidden".so pls help me.
I've cc'd the list with my response.

p.s. it's always best to start a new topic by creating a brand-new message, not by replying to an old one. Your question has nothing to do with the previous discussion on branch numbers, and (assuming it made it to the list) might have been ignored by someone who's flagged that thread as "not interesting".

reply via email to

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