<?xml version="1.0" encoding="windows-1252"?>
<node id="241331" title="Re[2]: Using CVS for revision control" created="2003-03-07 23:20:13" updated="2005-07-07 15:26:30">
<type id="11">
note</type>
<author id="23091">
PotPieMan</author>
<data>
<field name="doctext">
That's not entirely correct.

&lt;p&gt;CVS moves files that you have removed to a directory named &lt;code&gt;Attic&lt;/code&gt;. The directory is also under version control, meaning all of the logs are maintained on the old file.&lt;/p&gt;

&lt;p&gt;You can access the files later using &lt;code&gt;cvs update&lt;/code&gt;.  First, assume &lt;code&gt;test.pl&lt;/code&gt; is at version 1.1. Then, assume the following sequence of commands to rename the file under version control:&lt;/p&gt;
&lt;code&gt;$ mv test.pl test2.pl
$ cvs add test2.pl
$ cvs remove test.pl
$ cvs commit -m "Renamed test.pl to test2.pl"
cvs commit: Examining .
Removing test.pl;
/home/cvs/personal/projects/music/scripts/test.pl,v  &lt;--  test.pl
new revision: delete; previous revision: 1.1
done
RCS file: /home/cvs/personal/projects/music/scripts/test2.pl,v
done
Checking in test2.pl;
/home/cvs/personal/projects/music/scripts/test2.pl,v  &lt;--  test2.pl
initial revision: 1.1
done
&lt;/code&gt;

&lt;p&gt;You haven't really removed &lt;code&gt;test.pl&lt;/code&gt; from the repository. CVS has stored the file in the &lt;code&gt;Attic&lt;/code&gt; directory so that you still have access to it. To access just the log:&lt;/p&gt;
&lt;code&gt;$ cvs log test.pl

RCS file: /home/cvs/personal/projects/music/scripts/Attic/test.pl,v
Working file: test.pl
head: 1.2
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;     selected revisions: 2
description:
----------------------------
revision 1.2
date: 2003/03/08 04:04:23;  author: dwc;  state: dead;  lines: +0 -0
Renamed test.pl to test2.pl
----------------------------
revision 1.1
date: 2003/03/08 04:03:53;  author: dwc;  state: Exp;
Initial checkin
======================================================================&lt;/code&gt;

&lt;p&gt;If you want &lt;code&gt;test.pl&lt;/code&gt; back, you simply have to issue an update:&lt;/p&gt;
&lt;code&gt;$ cvs update -r 1.1 -p test.pl &gt; test.pl
===================================================================
Checking out test.pl
RCS:  /home/cvs/personal/projects/music/scripts/Attic/test.pl,v
VERS: 1.1
***************&lt;/code&gt;

&lt;p&gt;This is a special update that avoids using sticky revision tags. As far as I know, it must be specified to add a file back to the main repository that was previously removed. After recreating &lt;code&gt;test.pl&lt;/code&gt; from the previous revision, use the following sequence of commands to add it back to the repository:&lt;/p&gt;
&lt;code&gt;$ cvs add test.pl
$ cvs commit -m "Readded test.pl"&lt;/code&gt;

&lt;p&gt;I will admit that this is a fairly ugly way of dealing with the problem of renaming files and maintaining the versions on the old file, but saying that CVS throws away the log on the old file is misleading. After adding &lt;code&gt;test.pl&lt;/code&gt; back to the main repository, the log file would look as you expect:&lt;/p&gt;
&lt;code&gt;$ cvs log test.pl

RCS file: /home/cvs/personal/projects/music/scripts/test.pl,v
Working file: test.pl
head: 1.3
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 3;     selected revisions: 3
description:
----------------------------
revision 1.3
date: 2003/03/08 03:57:56;  author: dwc;  state: Exp;  lines: +0 -0
Readded test.pl
----------------------------
revision 1.2
date: 2003/03/08 03:55:18;  author: dwc;  state: dead;  lines: +0 -0
Renamed test.pl to test2.pl
----------------------------
revision 1.1
date: 2003/03/08 03:54:05;  author: dwc;  state: Exp;
Initial checkin
======================================================================&lt;/code&gt;

&lt;p&gt;I would argue that this is safer than editing the RCS admin files. If you make a mistake, all the developers on your team will have problems with the repository. This way, the developers will only see the files being removed or added after you have committed your changes.&lt;/p&gt;

&lt;p&gt;In general, to make sense of all the different versions in a repository, I prefer to use &lt;a href="http://viewcvs.sourceforge.net/"&gt;ViewCVS&lt;/a&gt;, a Web interface to CVS repositories similar to &lt;a href="http://www.freebsd.org/projects/cvsweb.html"&gt;CVSweb&lt;/a&gt;. It gives a very nice interface to the repository, including displaying files in the &lt;code&gt;Attic&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Update&lt;/b&gt;: Added missing close code tag.&lt;/p&gt;

&lt;p&gt;--PotPieMan&lt;/p&gt;</field>
<field name="root_node">
187449</field>
<field name="parent_node">
187636</field>
</data>
</node>
