Discussion:
How to restore Attic files in CVS
Trinh, An
2009-04-04 03:34:32 UTC
Permalink
Hello,

I have files that went into the Attic. How do I restore them back?
I've moved the files out of the Attic folder but when I checkout the
folder, the cvs GUI doesn't show any files under the folder. Viewing
the files revealed that they're in DEAD State. Please advise. Thank
you.

drwxrws---+ 3 11906 cvs_eai 512 Apr 3 09:41 .
drwxrws---+146 root cvs_eai 4608 Apr 2 14:25 ..
drwxrws---+ 2 c62ip74 cvs_eai 512 Apr 3 09:41 Attic
-rwxrwx---+ 1 c62ip74 cvs_eai 3136 Apr 3 13:08
EA_APRT_LOAD.esql,v
-rwxrwx---+ 1 c62ip74 cvs_eai 4153 Mar 18 08:11
EA_APRT_LOAD.msgflow,v
-rwxrwx---+ 1 c62ip74 cvs_eai 794 Mar 18 08:11 .project,v

Thanks,
An.

CONFIDENTIALITY NOTICE: This E-Mail is intended only for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you have received this communication in error, please do not distribute and delete the original message. Please notify the sender by E-Mail at the address shown. Thank you for your compliance.
Jim Hyslop
2009-04-05 04:54:27 UTC
Permalink
Trinh, An wrote:
> I have files that went into the Attic. How do I restore them back?
> I've moved the files out of the Attic folder but when I checkout the
> folder, the cvs GUI doesn't show any files under the folder. Viewing
> the files revealed that they're in DEAD State.

Someone has 'cvs remove'd the files. Just restore them with 'cvs add'.

- --
Jim Hyslop
Dreampossible: Better software. Simply. http://www.dreampossible.ca
Consulting * Mentoring * Training in
C/C++ * OOD * SW Development & Practices * Version Management
Peter Toft
2009-04-05 07:13:06 UTC
Permalink
On Sun, 5 Apr 2009, Jim Hyslop wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Trinh, An wrote:
>> I have files that went into the Attic. How do I restore them back?
>> I've moved the files out of the Attic folder but when I checkout the
>> folder, the cvs GUI doesn't show any files under the folder. Viewing
>> the files revealed that they're in DEAD State.
>
> Someone has 'cvs remove'd the files. Just restore them with 'cvs add'.

cvs log <file>
Find til newest non-dead version
cvs update -r <last-version> <file>
mv <file> foo
cvs update -A <file>
mv foo <file>
cvs add <file>
cvs commit -m "bring out your dead, bring out your dead" <file>

/pto



--
Peter Toft, Ph.D. [***@linuxbog.dk] http://petertoft.dk
I blog at http://www.version2.dk/blogs/petertoft
Larry Jones
2009-04-05 18:52:48 UTC
Permalink
Peter Toft writes:
>
> On Sun, 5 Apr 2009, Jim Hyslop wrote:
> >
> > Someone has 'cvs remove'd the files. Just restore them with 'cvs add'.
>
> cvs log <file>
> Find til newest non-dead version
> cvs update -r <last-version> <file>
> mv <file> foo
> cvs update -A <file>
> mv foo <file>
> cvs add <file>
> cvs commit -m "bring out your dead, bring out your dead" <file>

Neither of those suggestions is very good -- the first doesn't work at
all and the second is more complex than necessary and subject to error.
Please see the manual for the correct method:

<http://ximbiot.com/cvs/manual/cvs-1.11.23/cvs_5.html#SEC62>
--
Larry Jones

He's just jealous because I accomplish so much more than he does. -- Calvin
Trinh, An
2009-04-05 19:53:32 UTC
Permalink
Larry, Peter, Jim,

Thank you for your help. Larry, based upon your guidance the two steps
are straight forward.

$ cvs update -j 1.2 -j 1.1 file1
$ cvs commit -m test

However, when I ran the update command I'm getting Permission denied.

/usr/local/bin% cvs update -j 1.2 -j 1.1
/opt/prodcvs/eai/APRT/EA_APRT_LOAD.esql,v
permission denied
cvs [update aborted]: end of file from server (consult above messages if
any)

I'm using csh and the CVSROOT is set to:
CVSROOT=:ext:***@boc01:/opt/prodcvs

I've never executed any cvs command from the shell before since we use
cvs through the GUI interface with this connection
:extssh:***@boc01:/opt/prodcvs. I also tried putting in the same
connection that I connected with the GUI
:extssh:***@boc01:/opt/prodcvs and I'm getting this error.

/usr/local/bin% cvs update -j 1.2 -j 1.1
/opt/prodcvs/eai/APRT/EA_APRT_LOAD.esql,v
cvs update: Unknown method (`extssh') in CVSROOT.
cvs [update aborted]: Bad CVSROOT: `:extssh:***@boc01:/opt/prodcvs'.

Please advise and thank you for your help.

Thanks,
An.

-----Original Message-----
From: Larry Jones [mailto:***@siemens.com]
Sent: Sunday, April 05, 2009 2:53 PM
To: Peter Toft
Cc: Jim Hyslop; Trinh, An; info-***@gnu.org
Subject: Re: How to restore Attic files in CVS

Peter Toft writes:
>
> On Sun, 5 Apr 2009, Jim Hyslop wrote:
> >
> > Someone has 'cvs remove'd the files. Just restore them with 'cvs
add'.
>
> cvs log <file>
> Find til newest non-dead version
> cvs update -r <last-version> <file>
> mv <file> foo
> cvs update -A <file>
> mv foo <file>
> cvs add <file>
> cvs commit -m "bring out your dead, bring out your dead" <file>

Neither of those suggestions is very good -- the first doesn't work at
all and the second is more complex than necessary and subject to error.
Please see the manual for the correct method:

<http://ximbiot.com/cvs/manual/cvs-1.11.23/cvs_5.html#SEC62>
--
Larry Jones

He's just jealous because I accomplish so much more than he does. --
Calvin


CONFIDENTIALITY NOTICE: This E-Mail is intended only for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you have received this communication in error, please do not distribute and delete the original message. Please notify the sender by E-Mail at the address shown. Thank you for your compliance.
Jim Hyslop
2009-04-07 23:52:49 UTC
Permalink
Larry Jones wrote:
> Neither of those suggestions is very good -- the first doesn't work at
> all and the second is more complex than necessary and subject to error.

<sigh> I'm out of practice - been using Clearcase for the last year and
a half. Sorry for the misinformation.

- --
Jim Hyslop
Dreampossible: Better software. Simply. http://www.dreampossible.ca
Consulting * Mentoring * Training in
C/C++ * OOD * SW Development & Practices * Version Management
Larry Jones
2009-04-06 19:48:43 UTC
Permalink
Trinh, An writes:
>
> /usr/local/bin% cvs update -j 1.2 -j 1.1
> /opt/prodcvs/eai/APRT/EA_APRT_LOAD.esql,v
> permission denied
> cvs [update aborted]: end of file from server (consult above messages if
> any)

That implies that the user you're logging in to the server as doesn't
have write permission in that directory (/opt/prodcvs/eai/APRT).

> I'm using csh and the CVSROOT is set to:
> CVSROOT=:ext:***@boc01:/opt/prodcvs

Note that CVS doesn't use $CVSROOT when running in a working directory,
it uses the value saved in CVS/ROOT instead, so you may not be logging
in as the user you think you are. To force CVS to use $CVSROOT, use it
as the value of the -d global option:

cvs -d $CVSROOT update -j 1.2 -j 1.1
--
Larry Jones

Years from now when I'm successful and happy, ...and he's in
prison... I hope I'm not too mature to gloat. -- Calvin
Trinh, An
2009-04-07 15:32:54 UTC
Permalink
Hi Larry,

While running the update command I'm getting this error. Please advise.

boc01% /usr/local/bin/cvs -d /opt/prodcvs update -j 1.2 -j 1.1
/opt/prodcvs/eai/APRT/EA_APRT_LOAD.esql,v
cvs update: cannot open CVS/Entries for reading: No such file or
directory
cvs update: use `cvs add' to create an entry for
/opt/prodcvs/eai/APRT/EA_APRT_LOAD.esql,v
cvs [update aborted]: cannot open CVS/Root: No such file or directory


boc01% pwd
/opt/prodcvs/eai/APRT
boc01% ls -altr
total 34
-rwxrwx---+ 1 c62ip74 cvs_eai 794 Mar 18 08:11 .project,v
-rwxrwx---+ 1 c62ip74 cvs_eai 4153 Mar 18 08:11
EA_APRT_LOAD.msgflow,v
drwxrws---+146 root cvs_eai 4608 Apr 2 14:25 ..
drwxrws---+ 2 c62ip74 cvs_eai 512 Apr 3 09:41 Attic
-rwxrwx---+ 1 c62ip74 cvs_eai 3136 Apr 3 13:08
EA_APRT_LOAD.esql,v
drwxrws---+ 3 11906 cvs_eai 512 Apr 6 10:41 .

Thanks,
An.

-----Original Message-----
From: Larry Jones [mailto:***@siemens.com]
Sent: Monday, April 06, 2009 3:49 PM
To: Trinh, An
Cc: Peter Toft; Jim Hyslop; info-***@gnu.org
Subject: Re: How to restore Attic files in CVS - Permission Denied

Trinh, An writes:
>
> /usr/local/bin% cvs update -j 1.2 -j 1.1
> /opt/prodcvs/eai/APRT/EA_APRT_LOAD.esql,v
> permission denied
> cvs [update aborted]: end of file from server (consult above messages
> if
> any)

That implies that the user you're logging in to the server as doesn't
have write permission in that directory (/opt/prodcvs/eai/APRT).

> I'm using csh and the CVSROOT is set to:
> CVSROOT=:ext:***@boc01:/opt/prodcvs

Note that CVS doesn't use $CVSROOT when running in a working directory,
it uses the value saved in CVS/ROOT instead, so you may not be logging
in as the user you think you are. To force CVS to use $CVSROOT, use it
as the value of the -d global option:

cvs -d $CVSROOT update -j 1.2 -j 1.1
--
Larry Jones

Years from now when I'm successful and happy, ...and he's in prison... I
hope I'm not too mature to gloat. -- Calvin


CONFIDENTIALITY NOTICE: This E-Mail is intended only for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you have received this communication in error, please do not distribute and delete the original message. Please notify the sender by E-Mail at the address shown. Thank you for your compliance.
Larry Jones
2009-04-07 18:33:29 UTC
Permalink
Trinh, An writes:
>
> While running the update command I'm getting this error. Please advise.
>
> boc01% /usr/local/bin/cvs -d /opt/prodcvs update -j 1.2 -j 1.1
> /opt/prodcvs/eai/APRT/EA_APRT_LOAD.esql,v
> cvs update: cannot open CVS/Entries for reading: No such file or
> directory

Assuming you're running the command in the working directory where the
file should be (which is what you should be doing), you just want the
file name, not the path to the repository version:

cvs -d /opt/prodcvs update -j 1.2 -j 1.1 EA_APRT_LOAD.esql

Even though the file doesn't exist in the working directory (because it
was deleted), CVS knows how to find it in the repository and get it
back.
--
Larry Jones

The problem with the future is that it keeps turning into the present.
-- Hobbes
Trinh, An
2009-04-07 18:39:51 UTC
Permalink
Larry,

Yes, I've done that but still getting the same error. Please advise.

boc01% pwd
/opt/prodcvs/eai/APRT
boc01% ls -altr
total 34
-rwxrwx---+ 1 c62ip74 cvs_eai 794 Mar 18 08:11 .project,v
-rwxrwx---+ 1 c62ip74 cvs_eai 4153 Mar 18 08:11
EA_APRT_LOAD.msgflow,v
drwxrws---+146 root cvs_eai 4608 Apr 2 14:25 ..
drwxrws---+ 2 c62ip74 cvs_eai 512 Apr 3 09:41 Attic
-rwxrwx---+ 1 c62ip74 cvs_eai 3136 Apr 3 13:08
EA_APRT_LOAD.esql,v
drwxrws---+ 3 11906 cvs_eai 512 Apr 6 10:41 .
boc01% /usr/local/bin/cvs -d /opt/prodcvs update -j 1.2 -j 1.1
EA_APRT_LOAD.esql,v
cvs update: cannot open CVS/Entries for reading: No such file or
directory
cvs update: use `cvs add' to create an entry for EA_APRT_LOAD.esql,v
cvs [update aborted]: cannot open CVS/Root: No such file or directory
boc01%
boc01%
boc01% /usr/local/bin/cvs -d /opt/prodcvs update -j 1.2 -j 1.1
EA_APRT_LOAD.esql
cvs update: cannot open CVS/Entries for reading: No such file or
directory
cvs update: nothing known about EA_APRT_LOAD.esql
cvs [update aborted]: cannot open CVS/Root: No such file or directory


Thanks,
An.
2-3092
215-241-3092

-----Original Message-----
From: Larry Jones [mailto:***@siemens.com]
Sent: Tuesday, April 07, 2009 2:33 PM
To: Trinh, An
Cc: Peter Toft; Jim Hyslop; info-***@gnu.org
Subject: Re: How to restore Attic files in CVS - cannot open CVS/Entries

Trinh, An writes:
>
> While running the update command I'm getting this error. Please
advise.
>
> boc01% /usr/local/bin/cvs -d /opt/prodcvs update -j 1.2 -j 1.1
> /opt/prodcvs/eai/APRT/EA_APRT_LOAD.esql,v
> cvs update: cannot open CVS/Entries for reading: No such file or
> directory

Assuming you're running the command in the working directory where the
file should be (which is what you should be doing), you just want the
file name, not the path to the repository version:

cvs -d /opt/prodcvs update -j 1.2 -j 1.1 EA_APRT_LOAD.esql

Even though the file doesn't exist in the working directory (because it
was deleted), CVS knows how to find it in the repository and get it
back.
--
Larry Jones

The problem with the future is that it keeps turning into the present.
-- Hobbes


CONFIDENTIALITY NOTICE: This E-Mail is intended only for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you have received this communication in error, please do not distribute and delete the original message. Please notify the sender by E-Mail at the address shown. Thank you for your compliance.
Larry Jones
2009-04-07 18:44:26 UTC
Permalink
Trinh, An writes:
>
> Yes, I've done that

No, you haven't. You're still trying to run the command in the
repository instead of in a working directory that you've checked out.
--
Larry Jones

I don't want to be THIS good! -- Calvin
Trinh, An
2009-04-07 18:49:41 UTC
Permalink
Larry,

I have deleted the working directory that I've checked out. Just now,
I've checked out this project APRT and there's nothing inside. Is it
still possible for me to recover the file?

Thanks,
An.

-----Original Message-----
From: Larry Jones [mailto:***@siemens.com]
Sent: Tuesday, April 07, 2009 2:44 PM
To: Trinh, An
Cc: Peter Toft; Jim Hyslop; info-***@gnu.org
Subject: Re: How to restore Attic files in CVS - cannot open CVS/Entries

Trinh, An writes:
>
> Yes, I've done that

No, you haven't. You're still trying to run the command in the
repository instead of in a working directory that you've checked out.
--
Larry Jones

I don't want to be THIS good! -- Calvin


CONFIDENTIALITY NOTICE: This E-Mail is intended only for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you have received this communication in error, please do not distribute and delete the original message. Please notify the sender by E-Mail at the address shown. Thank you for your compliance.
Larry Jones
2009-04-07 18:53:41 UTC
Permalink
Trinh, An writes:
>
> I have deleted the working directory that I've checked out. Just now,
> I've checked out this project APRT and there's nothing inside. Is it
> still possible for me to recover the file?

Yes, when you run the update in the empty directory, the file will
magically reappear.
--
Larry Jones

Why can't I ever build character in a Miami condo or a casino somewhere?
-- Calvin
Trinh, An
2009-04-07 19:06:33 UTC
Permalink
Larry,

From the CVS GUI, I've checked out the APRT. Here are the info.

Connection type: extssh
User: c62ip74
Host: boc01
Port: Default
Repository path: /opt/prodcvs
Module: eai/APRT
Tag: Head

How do I know the directory name that's mapped to on the server?
According to your advice, I need to be in the directory in order to run
the command below. I've reran the command below again under
/opt/prodcvs/eai/APRT.

boc01% pwd
/opt/prodcvs/eai/APRT
boc01% /usr/local/bin/cvs -d /opt/prodcvs update -j 1.2 -j 1.1
EA_APRT_LOAD.esql,v
cvs update: cannot open CVS/Entries for reading: No such file or
directory
cvs update: use `cvs add' to create an entry for EA_APRT_LOAD.esql,v
cvs [update aborted]: cannot open CVS/Root: No such file or directory


Thanks,
An.

-----Original Message-----
From: Larry Jones [mailto:***@siemens.com]
Sent: Tuesday, April 07, 2009 2:54 PM
To: Trinh, An
Cc: Peter Toft; Jim Hyslop; info-***@gnu.org
Subject: Re: How to restore Attic files in CVS - cannot open CVS/Entries

Trinh, An writes:
>
> I have deleted the working directory that I've checked out. Just now,

> I've checked out this project APRT and there's nothing inside. Is it
> still possible for me to recover the file?

Yes, when you run the update in the empty directory, the file will
magically reappear.
--
Larry Jones

Why can't I ever build character in a Miami condo or a casino somewhere?
-- Calvin


CONFIDENTIALITY NOTICE: This E-Mail is intended only for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you have received this communication in error, please do not distribute and delete the original message. Please notify the sender by E-Mail at the address shown. Thank you for your compliance.
Larry Jones
2009-04-07 19:16:30 UTC
Permalink
Trinh, An writes:
>
>
Trinh, An
2009-04-07 19:53:15 UTC
Permalink
Larry,

I've checked out the APRT into /home/c62ip74/APRT. When running the CVS
Update, I'm getting Nothing Know about EA_APRT_LOAD.esql,v. Please
advise.

boc01% pwd
/home/c62ip74/APRT
boc01% /usr/local/bin/cvs -d /opt/prodcvs checkout -d /home/c62ip74/APRT
eai/APRT
cvs checkout: Updating /home/c62ip74/APRT
boc01%
boc01% pwd
/home/c62ip74/APRT
boc01%
boc01% /usr/local/bin/cvs -d /opt/prodcvs update -j 1.2 -j 1.1
EA_APRT_LOAD.esql,v
cvs update: nothing known about EA_APRT_LOAD.esql,v


boc01% cd CVS
boc01% ls -al
total 10
drwxrwxrwx 2 c62ip74 edisw 512 Apr 7 15:36 .
drwxrwxrwx 3 c62ip74 edisw 512 Apr 7 15:36 ..
-rw-rw-rw- 1 c62ip74 edisw 2 Apr 7 15:36 Entries
-rw-rw-rw- 1 c62ip74 edisw 9 Apr 7 15:36 Repository
-rw-rw-rw- 1 c62ip74 edisw 13 Apr 7 15:36 Root

Thanks,
An.

-----Original Message-----
From: Larry Jones [mailto:***@siemens.com]
Sent: Tuesday, April 07, 2009 3:17 PM
To: Trinh, An
Cc: Peter Toft; Jim Hyslop; info-***@gnu.org
Subject: Re: How to restore Attic files in CVS - cannot open CVS/Entries

Trinh, An writes:
>
>
Larry Jones
2009-04-07 19:57:09 UTC
Permalink
Trinh, An writes:
> boc01%
> boc01% /usr/local/bin/cvs -d /opt/prodcvs update -j 1.2 -j 1.1
> EA_APRT_LOAD.esql,v
> cvs update: nothing known about EA_APRT_LOAD.esql,v

The ,v files are repository files, the working files do not have that
suffix. So, you want:

/usr/local/bin/cvs update -j 1.2 -j 1.1 EA_APRT_LOAD.esql

(There's no need for the -d, CVS remembers it from the checkout.)
--
Larry Jones

Apparently I was misinformed. -- Calvin
Trinh, An
2009-04-07 20:13:00 UTC
Permalink
Hi Larry,

Thank you very much for your help! It works. To summarize here are the
commands I've executed to restore a dead version in the Attic.

boc01% pwd
/home/c62ip74/APRT
boc01% /usr/local/bin/cvs -d /opt/prodcvs checkout -d /home/c62ip74/APRT
eai/APRT
cvs checkout: Updating /home/c62ip74/APRT
boc01%
boc01% /usr/local/bin/cvs update -j 1.2 -j 1.1 EA_APRT_LOAD.esql
U EA_APRT_LOAD.esql
boc01% /usr/local/bin/cvs commit -m "An restored dead version"
cvs commit: Examining .
cvs commit: warning: expected /opt/prodcvs/eai/APRT/EA_APRT_LOAD.esql,v
to be in Attic
Checking in EA_APRT_LOAD.esql;
/opt/prodcvs/eai/APRT/EA_APRT_LOAD.esql,v <-- EA_APRT_LOAD.esql
new revision: 1.3; previous revision: 1.2

I do see the new version from the CVS GUI now.
Again, thank you very much for your time and your valuable advice on
this.

Thank you Larry,
An.

-----Original Message-----
From: Larry Jones [mailto:***@siemens.com]
Sent: Tuesday, April 07, 2009 3:57 PM
To: Trinh, An
Cc: Peter Toft; Jim Hyslop; info-***@gnu.org
Subject: Re: How to restore Attic files in CVS - cannot open CVS/Entries

Trinh, An writes:
> boc01%
> boc01% /usr/local/bin/cvs -d /opt/prodcvs update -j 1.2 -j 1.1
> EA_APRT_LOAD.esql,v cvs update: nothing known about
> EA_APRT_LOAD.esql,v

The ,v files are repository files, the working files do not have that
suffix. So, you want:

/usr/local/bin/cvs update -j 1.2 -j 1.1 EA_APRT_LOAD.esql

(There's no need for the -d, CVS remembers it from the checkout.)
--
Larry Jones

Apparently I was misinformed. -- Calvin


CONFIDENTIALITY NOTICE: This E-Mail is intended only for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you have received this communication in error, please do not distribute and delete the original message. Please notify the sender by E-Mail at the address shown. Thank you for your compliance.
Loading...