|
|
FAQ
Welcome to the softdevel FAQ.
- CVS
- Information about Concurrent Version Control (CVS) for CHESS, TRUST and Embedded webpage authors and developers.
This information is based on the GSRC CVS FAQ, which was written by John Reekie, Allen Hopkins, Christopher Brooks and others. There is a cached, out of date copy at http://chess.eecs.berkeley.edu/softdevel/oldfaq.htm
- Getting Started With CVS
- Copied from John Reekie's CVS Page.
See also Subversion On Departmental Server: The instructions for setting up Subversion to allow one user to safely store revisions of papers and software on a departmental file server that is backed up.
Getting started with CVS
Some simple exercises to get things going. This worked for me on
Solaris. For Windows, it should be basically the same if you install
the Cyclic Software CVS binaries.
Add this to .cshrc and source it:
setenv CVSROOT ~/Repository
When I tried it on Windows, the Windows version of
CVS seems to assume that the Windows machine is running as a CVS
client to a remote server. To have it run the server locally, set
CVSROOT in the System control panel to eg:
:local:c:usersjohnrRepository
Create the CVS repository
cvs init
Create a new directory tree:
cd ~/java
mkdir diva
mkdir diva/canvas
mkdir diva/kernel
Import the new directory into CVS:
cd diva
cvs import -m "Created directory" diva local start
Get a working version of the new directory structure:
cd ..
mv diva diva.orig
cvs checkout diva
Tell CVS to
set permissions so that files are read-only until a "cvs edit"
is performed on them:
cvs watch on diva
Create a new source file in diva/canvas. Here's
a sample:
// A simple Java file
// $Header: /home/johnr/cvs/eecs.berkeley.edu/info/cvs.html,v 1.1.1.1 1998/07/20 21:42:55 johnr Exp $
class Foo {
public static void main(String[] argv) {
System.out.println("Foo!");
}
}
Add the file to CVS:
cd ~/java/diva/canvas
cvs add Foo.java
cvs commit Foo.java
chmod 444 Foo.java
Check out the file for editing:
cvs edit Foo.java
Check the file back in:
cvs commit Foo.java
- How do I get a CVS account?
- CVS accounts are available to anyone who has a login on chess.eecs.berkeley.edu or embedded.eecs.berkeley.edu, and is working on a project that is doing software development. To request a CVS account, use the CVS Account Request Form. You should get email with your account details within a day or so. (If not, by all means send email Contact the CHESS staff and ask about the status of your request!)
Note that CVS accounts cannot be created in response to a simple email request. The form above generates passwords and a script that is used to create your account, saves a lot of time and generally makes the whole process more reliable. It helps us a lot if you use it :-)
- What do I do to get started using CVS on the CHESS/Embedded website?
- CHESS Users, see How do I edit pages in a group with the CVS Authoring option?
- Common CVS Commands
- Below is some text from William Wu about CVS commands
-
cvs import [module|file]
- add files/modules into the repository directory.
cvs commit [module|file]
- Check in your modified files/module to the repository,
creates a new file that merge your file and the one in
repository. Note it is a MERGE not a replace, so it could
cause problem. A good rule is to after you modified the
file, do a cvs update (see below) first, so you have the
newest version, and try to recompile and run, so that you
can find any conflict that arise.
cvs update [module|file]
- updates your files to the files in the repository,
if you have made some change to your files, it will
merge the two. This is always a good thing to do before
you do commit, since someone else can modify the file
and check in after you last update, thus it is possible
the changes he made is in conflict with you changes.
By doing a update, you can find out about the changes he made
and spot any conflict. (conflict is indicated by a letter c
in front of file name, in the messages from CVS)
You can run cvs -n update to preview what
would happen if you ran cvs update. The -n
option does not change any files, it only issues reports.
Note that usually you will want to use
cvs update -P -d, which Prunes empty
directories and creates new directories. You can
set this as the default by creating a
~/.cvsrc file that contains the line
update -P -d
If you run cvs update without the -d flag,
then you might not get any new directories created
cvs checkout [module|file]
- Use this when you check out the files/module for the first time.
When someone had import a new file in, you can use this command
to check it out, or I think do a update on the module will also
add the new file to you directory.
cvs add file
- Add a file or directory to the repository.
For binary files like PDFs or image files, use
cvs add -kb file. The -kb prevents keyword substitution when a
binary file is checked out. To fix a file that was
checked in without -kb, see
Admin commands.
cvs status [module|file]
- Give a status report on the files comparing with the newest
version in the repository. The files status can be Up-to-Date,
Modified ... Uses this command before commit, then you can
check if you need to do a update or not.
cvs diff [module|file]
- does a diff with your file and its newest version in repository.
cvs history [module|file]
- gives a report on the history of modication done on this file,
users, date etc.
These are some commonly used ones, you can always use
cvs(1)
man page for help.
- How do I use CVS without typing my password each time?
- To use CVS to update files without typing your password, you will need first need a CVS account, see
How do I get a CVS account? and request an
individual account. In the comments section
be sure to state that you think you have a shared
account and that you would like your account
recreated as an individual account so
that you do not have to type your password.
The steps below are slightly modified from the
CVS SSH instructions
SSH (and therefore CVS) can use RSA and Rhosts style authentication to
make it so that you can login without typing your password. Using Rhosts authentication alone is insecure,
and most CVS servers (this one included) disallow it.
RSA can be used with or without Rhosts authentication.
Using RSA alone, any user with the appropriate RSA
key and passphrase can access the repository.
Using RSA and Rhosts restricts repository access to only computers listed in Rhosts that also have the appropriate RSA key.
Note that for RSA with Rhosts authentication
to work, each host that
you are logging in from needs to be listed in two files.
If you are connecting from multiple hosts via dynamic
DSL, then each time you connect, you are likely to
have a different address, which makes managing
the file difficult. There are several possible
solutions, one is to try to use wildcards
in ~/.ssh/known_hosts and ~/.shosts,
the other is to run a script that updates these
files automatically. Both solutions are complex
and have security issues, so we do not cover them here.
It is much simpler to use RSA authentication alone
in this case.
RSA authentication
Once your account has been set up, do the following:
- Create
~/.ssh/id_rsa.pub on the
local machine:
Unix, including probably Mac OS X:
If ~/.ssh/id_rsa.pub does not exist,
on your local machine,
then create it by running ssh-keygen -t rsa
When prompted for a passphrase, hit return.
If you type in a passphrase here, you will be prompted
for that passphrase each time.
Running ssh-keygen will generate the files
~/.ssh/id_rsa and
~/.ssh/id_rsa.pub, which
are your private and public encryption keys respectively.
Windows:
- Download and install PuTTY (Download the installer so that you get
PuTTYgen.
- Invoke
PuTTYgen
- Move the mouse around to generate randomness :-)
- Do not enter a passphrase, if you enter a passphrase
here, you will be prompted for that passphrase each time.
- Click on "Save Private Key" and save the file to a
location to be used by TortoiseCVS (FIXME: need more info about the location here)
- Click on "Save Public Key". The public key is what is should be transferred to the cvs or svn server.
- FIXME: need info about setting up TortoiseCVS with
the PuTTY key.
- Create
~/.ssh/authorized_keys2 on
source:
Set the permission of ~/.ssh/id_rsa.pub
to 0644 and then
copy ~/.ssh/id_rsa.pub over
to ~/.ssh/authorized_keys2 with the
scp -p flag to preserve permissions.
chmod 0644 ~/.ssh/id_rsa.pub
scp -p ~/.ssh/id_rsa.pub yoursourcelogin@source:~/.ssh/authorized_keys2
where yoursourcelogin is the your CVS login
on source.eecs.berkeley.edu (which may be different
from your website login)
- From the local machine, test ssh with:
ssh yoursourcelogin@source.eecs.berkeley.edu cvs
to check the set up.
Below is a sample run
cxh@DOPLAP03 ~
$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/cygdrive/c/cxh/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /cygdrive/c/cxh/.ssh/id_rsa.
Your public key has been saved in /cygdrive/c/cxh/.ssh/id_rsa.pub.
The key fingerprint is:
03:2a:8a:3b:96:93:6b:74:86:c8:ea:30:e2:c9:11:68 cxh@DOPLAP03
cxh@DOPLAP03 ~
$ chmod 0644 ~/.ssh/id_rsa.pub
cxh@DOPLAP03 ~
$ scp ~/.ssh/id_rsa.pub cxh@source.eecs.berkeley.edu:~/.ssh/authorized_keys2
The authenticity of host 'source (128.32.171.225)' can't be established.
RSA key fingerprint is 74:57:84:9b:ca:b8:44:1d:fa:f0:e3:27:29:ac:19:c6.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'source,128.32.171.225' (RSA) to the list of know
n hosts.
cxh@source's password:
id_rsa.pub 100% |*****************************| 222 00:00
cxh@DOPLAP03 ~
$ ssh cxh@source.eecs.berkeley.edu cvs
Usage: cvs [cvs-options] command [command-options-and-arguments]
where cvs-options are -q, -n, etc.
(specify --help-options for a list of options)
where command is add, admin, etc.
(specify --help-commands for a list of commands
or --help-synonyms for a list of command synonyms)
where command-options-and-arguments depend on the specific command
(specify -H followed by a command name for command-specific help)
Specify --help to receive this message
The Concurrent Versions System (CVS) is a tool for version control.
For CVS updates and additional information, see
the CVS home page at http://www.cvshome.org/ or
Pascal Molli's CVS site at http://www.loria.fr/~molli/cvs-index.html
cxh@DOPLAP03 ~
$
The above steps should not prompt you for your password each time you run a cvs command. There are two ways to enable yourself to not type a passphrase each time.
The first is to use only RSA authentication as described above, and give an empty passphrase.
Note that this means that if someone steals your laptop and breaks into your account, they will be able to use the ssh command to get on to your Unix account.
RSA authentication works with ssh1 and ss2.
The second way is to set up Rhosts RSA authentication,
which currently only works with ssh1.
In this case, ssh will authenticate your computer instead of you. It is somewhat safer for your computer to log in without a password
because the CVS server can determine where your computer
is located. Your computer can only login without
a password if it also has the correct name and IP.
This method is shown below.
Rhosts RSA authentication
These instructions apply to ssh1 clients, like
the version of ssh that is currently shipped with cvsssh.
For ssh2, see above.
- Setup
~/.shosts on gigasource:
Create a temporary file on your local machine that
contains the name of the host you will be logging in
from.
echo "myhost.eecs.berkeley.edu" > /tmp/shosts
- Change the permissions of the file on you local
machine so that it is only readable by you. Note
that you can't run
chmod on the remote
machine under rksh, so you need to fix the permissions
before you copy the file over.
chmod 0600 /tmp/shosts
- Copy the file over:
scp /tmp/shosts gigasource:~/.shosts
Below is a sample session
ptolemy@myhost 4% echo "myhosts.eecs.berkeley.edu" > /tmp/shosts
ptolemy@myhost 5% chmod 0600 /tmp/shosts
ptolemy@myhost 6% scp /tmp/shosts gigasource:~/.shosts
Enter passphrase for RSA key 'ptolemy@myhost.eecs.berkeley.edu': your passphrase
^Mshosts | 0 KB | 0.0 kB/s | ETA: 00:00:00 | 100%
ptolemy@myhost 7%
- On your Windows machine, check to see if the file
c:sshetcssh_host_key.pub exists:
- If it does not exist, generate host keys on your Unix machine
and copy them over. Note that the ssh-keygen command
that is shipped with the Windows CVS SSH package will
not work, you should run
ssh-keygen
on a Unix host. Note that the -N below indicates
that your computer will not have a passphrase.
cd /tmp
ssh-keygen -b 1024 -f ssh_host_key -N ''
On Windows, you can copy the files with scp. If you use scp here,
note that scp does not understand the Windows c: naming convention,
it think c: is a machine named 'c'. To copy the file under bash
on Windows:
cd c:/ssh/etc
scp yourunixmachine:/tmp/ssh_host_key.pub .
scp yourunixmachine:/tmp/ssh_host_key .
On the Unix machine, remove /tmp/ssh_host_key
- If c:/etc/ssh/ssh_host_key.pub exists on your Windows machine,
copy it to a temporary file on the Unix machine:
cd c:/ssh/etc
scp ssh_host_key.pub yourunixmachine:/tmp
- Set up
~/.ssh/known_hosts on gigasource:
On gigasource, ~/.ssh/known_hosts lists hosts
that are allowed to connect without a password. Since
we can't edit files on gigasource from the restricted shell,
we create the file on the local machine and copy it
over to gigascale.
Note that if you are connecting from multiple machines,
you will need to add a line to this file for each
machine you are connecting from. The easiest way
to do this is to use scp to transfer the file
to a local machine, edit the file locally and then
scp it back to gigasource.
- Grab the contents of the copy of ssh_host_key.pub that
you either generated or copied over, and create a temporary
file
- Add the fully qualified domain name of the windows machine
to the beginning of the line.
You should end up with something like
maury.eecs.berkeley.edu 1024 17 27348124368712489214987214872164987243
Where the last number is several lines long.
- Copy the file:
scp /tmp/known_hosts source:~/.ssh/known_hosts
- From the local machine, test ssh with:
ssh -v source cvs
you should not have to type in your password.
Troubleshooting CVS SSH under NT
- Run
ssh -v yourunixmachine cvs
and check the output, which should look like:
ptolemy@carson 8% ssh -v source cvs
SSH Version 1.2.26 [sparc-sun-solaris2.5.1], protocol version 1.5.
Standard version. Does not use RSAREF.
carson.eecs.berkeley.edu: Reading configuration data /etc/ssh_config
carson.eecs.berkeley.edu: ssh_connect: getuid 4035 geteuid 0 anon 0
carson.eecs.berkeley.edu: Connecting to gigasource [128.32.171.225] port 22.
carson.eecs.berkeley.edu: Allocated local port 1021.
carson.eecs.berkeley.edu: Connection established.
carson.eecs.berkeley.edu: Remote protocol version 1.5, remote software version
1.2.26
carson.eecs.berkeley.edu: Waiting for server public key.
carson.eecs.berkeley.edu: Received server public key (768 bits) and host key (1
024 bits).
carson.eecs.berkeley.edu: Host 'gigasource' is known and matches the host key.
carson.eecs.berkeley.edu: Initializing random; seed file /users/ptolemy/.ssh/ra
ndom_seed
carson.eecs.berkeley.edu: Encryption type: idea
carson.eecs.berkeley.edu: Sent encrypted session key.
carson.eecs.berkeley.edu: Installing crc compensation attack detector.
carson.eecs.berkeley.edu: Received encrypted confirmation.
carson.eecs.berkeley.edu: Trying rhosts or /etc/hosts.equiv with RSA host authe
ntication.
carson.eecs.berkeley.edu: Remote: Accepted by .shosts.
carson.eecs.berkeley.edu: Remote: Your host key cannot be verified: unknown or
invalid host key.
carson.eecs.berkeley.edu: Remote: The host name used to check the key was 'cars
on.eecs.berkeley.edu'.
carson.eecs.berkeley.edu: Remote: Try logging back from the server machine with
the canonical host name using ssh, and then try again.
carson.eecs.berkeley.edu: Server refused our rhosts authentication or host key.
carson.eecs.berkeley.edu: No agent.
carson.eecs.berkeley.edu: Trying RSA authentication with key 'ptolemy@maury.eec
s.berkeley.edu'
carson.eecs.berkeley.edu: Received RSA challenge from server.
carson.eecs.berkeley.edu: Bad passphrase supplied for key file /users/ptolemy/.
ssh/identity.
Enter passphrase for RSA key 'ptolemy@maury.eecs.berkeley.edu': your CVS passphrase
carson.eecs.berkeley.edu: Sending response to host key RSA challenge.
carson.eecs.berkeley.edu: Remote: RSA authentication accepted.
carson.eecs.berkeley.edu: RSA authentication accepted by server.
carson.eecs.berkeley.edu: Requesting X11 forwarding with authentication spoofin
g.
carson.eecs.berkeley.edu: Sending command: cvs
carson.eecs.berkeley.edu: Entering interactive session.
Usage: cvs [cvs-options] command [command-options-and-arguments]
where cvs-options are -q, -n, etc.
(specify --help-options for a list of options)
where command is add, admin, etc.
(specify --help-commands for a list of commands
or --help-synonyms for a list of command synonyms)
where command-options-and-arguments depend on the specific command
(specify -H followed by a command name for command-specific help)
Specify --help to receive this message
The Concurrent Versions System (CVS) is a tool for version control.
For CVS updates and additional information, see
Cyclic Software at http://www.cyclic.com/ or
Pascal Molli's CVS site at http://www.loria.fr/~molli/cvs-index.html
carson.eecs.berkeley.edu: Transferred: stdin 0, stdout 716, stderr 0 bytes in 0
.1 seconds
carson.eecs.berkeley.edu: Bytes per second: stdin 0.0, stdout 12490.8, stderr 0
.0
carson.eecs.berkeley.edu: Exit status 1
ptolemy@carson 9%
- Check the value of the CVSROOT environment variable. It should
be something like:
:ext:myhost.eecs.berkeley.edu:/users/cvs/Repository
- Be sure that you have created a key on the Unix side and
copied the identity* files from Unix to NT
- Be sure that $HOME is set for your NT account
- Try using the ssh.exe binary that the $CVS_RSH variable refers to.
Below is an example where we rsh over to carson and get the date:
bash-2.02$ echo $CVS_RSH
D:Program FilesPtolemyCVS SSHssh.exe
bash-2.02$ /Program Files/Ptolemy/CVS SSH/ssh carson date
Enter passphrase for RSA key 'cxh@myhost.eecs.berkeley.edu':
ld.so.1: /usr/local/bin/xauth: warning: /usr/4lib/libXmu.so.4.0: has older revision than expected 10
Thu Feb 4 15:35:06 PST 1999
Below is an example that failed because of an incorrect CVS password, note that the password is prompted
for twice:
bash-2.02$ /Program Files/Ptolemy/CVS SSH/ssh carson date
Enter passphrase for RSA key 'cxh@myhost.eecs.berkeley.edu':
Bad passphrase.
Password:
Permission denied.
bash-2.02$
- Verify that you can use ssh to connect between two Unix boxes.
- Check ssh_config. RSAAuthentication and/or RhostsRSAAuthentication must be turned on. One way to do this locally is by having an /Program Files/Ptolemy/CVS SSH/ssh_config file that looks like:
Host *
RSAAuthentication yes
RhostsRSAAuthentication yes
- Reboot NT.
|
Cygwin CR/NL problemsAfter about 2009, Cygwin installs with
line endings that are set up for Linux gurus that fail
for most Windows users.
See Ptolemy II Cygwin installation instructions for details, which are partially reproduced
below:
- Set bash to ignore carriage returns '\r'
The problem is that shell scripts such as
$PTII/bin/vergil will fail:
$ export PTII=c:/user/ptII
$ $PTII/bin/vergil
c:/user/ptII/bin/vergil: line 30: $'\r': command not found
c:/user/ptII/bin/vergil: line 40: $'\r': command not found
c:/user/ptII/bin/vergil: line 43: $'\r': command not found
c:/user/ptII/bin/vergil: line 48: $'\r': command not found
c:/user/ptII/bin/vergil: line 67: syntax error near unexpected token `$'in\r''
':/user/ptII/bin/vergil: line 67: ` case "`uname -s`" in
Another possible solution is to create a ~/.bash_profile that contains
export SHELLOPTS
set -o igncr
To find your home directory, start up Cygwin bash and type
cd;pwd. Then use an editor like Wordpad.
See also:
OLD Information below here
When Cygwin is installed, you should be sure to select
DOS for the Default Text File Type.
If you do not, then when you check in files, there
will be problems with the DOS CR/NL line endings.
In particular, what will happen is that when you
check in a file and then someone checks it out, it
will have extra \r or ^M characters.
The way to tell if this is a problem is to run
the mount command under Cygwin bash and
note whether the c: drive is mounted
textmode or not. If the c:
drive is mounted textmode, then
your setup is ok:
$ mount
c:\cygwin\bin on /usr/bin type system (textmode)
c:\cygwin\lib on /usr/lib type system (textmode)
c:\cygwin on / type system (textmode)
c: on /cygdrive/c type user (textmode,noumount)
However, if c: is mounted binmode,
then you have problems:
$ mount
c:\cygwin2\bin on /usr/bin type system (binmode)
c:\cygwin2\lib on /usr/lib type system (binmode)
c:\cygwin2 on / type system (binmode)
c: on /cygdrive/c type user (binmode,noumount)
The fastest solution is to reinstall Cygwin,
see How do I edit pages in a group with the "CVS Authoring" option?
and properly select
DOS for the Default Text File Type.
Another possible alternative is to use these mount
commands:
We have tried these commands but they have not
quite worked for us
mount -f -t -s c:\\cygwin\\lib /usr/lib
mount -f -t -s c:\\cygwin\\bin /usr/bin
mount -f -t -s c:\\cygwin /
mount -f -t c: /cygdrive/c
If you have a d: drive,you may need to do:
mount -f -t d: /cygdrive/c
When you are done, run mount, which should
show all the mounts as textmode.
The reason that this is a problem with CVS is that
CVS handles end of line translation between Unix and Windows.
If, under Cygwin, the directories are mounted
binmode, then Cygwin CVS will not do
the proper translations.
For details, see
How is the DOS/Unix CR/LF thing handled? in the Cygwin FAQ
See also
http://cygwin.com/cygwin-ug-net/using-textbinary.html
To replicate the problem, install Cygwin with Unix line
endings, check out a file using CVS, edit the file using
wordpad and check in your changes. When you check out
the file under Unix, it will have \r\n
line endings.
Note that there is some contention about whether
DOS or Unix line endings are correct. The TinyOS community
has required Cygwin to be set up with Unix line endings,
which works great if your users are technically
sophisticated. However, if your windows users do not have
much exposure to Unix, then configuring Cygwin to use
DOS line endings is more correct.
How do I set it up so that I get email whenever someone commits a change?To set up email for CVS or Subversion:
- Email will be set to people with
developer accounts
in a workgroup. To enable the developer choice,
the admin of the workgroup should go to Admin -> Group Profile and select Software Project
- the admin of
the workgroup should go to the Admin->Configure Group page
and click on the
CVS mail list checkbox
- then
hit the
Change group configuration button
at the bottom.
This will send email to the website managers
who will create the mailing list and edit the
loginfo file.
If a workgroup member would like to get email about
cvs changes, they should go to
Options -> Membership and request a Developer account for
the corresponding workgroup.
(Website managers: the instructions for what to do for CVS are in] the dopsysadmin workgroup: How do I set up CVS mail?
For Subversion, see
Setting up SVN Email)
See also How do I send commit log messages to a mailing list?
TortoiseCVS does not work for me under Windows 7, what do I do?Yep, it seems like TortoiseCVS has problems under Windows 7.
Google
TortoiseCVS Windows 7
The problem is with icon overlays. Installing TortoiseSVN will work on a Windows 7
machine, but if other software is installed that messes with the icons, then TortoiseCVS
will mysteriously stop working. This is not very easy to diagnose or maintain.
TortoiseCVS is better than WinCVS if TortoiseCVS continues to work.
If someone installs lots of software on their machine, then TortoiseCVS may stop working.
Blame Microsoft.
There are ways to work around this problem, but
they are not for the faint of heart.
On 1/31/11, http://www.tortoisecvs.org/download.shtml said:
Vista and Windows 7 is also supported, although some people report problems with UAC.
UAC is User Account Control.
I blame Microsoft, they changed their API. There are various fixes
that can be tried, but you might try WinCVS or SmartCVS.
WinCVS
WinCVS can be downloaded via
http://cvsgui.sourceforge.net/download.html
Install WinCVS, start it up, then click on Remote -> Checkout Module.
Typical settings:
Module name: ptpapers/11
CVSROOT:ssh:cxh@source.eecs.berkeley.edu:/home/cvs_chess
SmartCVS
SmartCVS is commercial software that seemed to work for me. Apparently
there is a free version. The default install has a 30 day license for the
professional version that reverts to the free version. I'm not sure
if this is a good thing.
Adminstrative CVS CommandsBelow are some common scenarios for fixing up the CVS database.
See the FAQ for more examples.
Ignoring files
/users/cvs/Repository/CVSROOT/cvsignore contains
the patterns for files that are ignored when cvs update is done.
If cvsignore includes *.class,
then when you do cvs update, you won't see messages like
? DEActor.class
? DEDirector.class
Adding a directory
- Create the directory
mkdir foo
- Update the Repository and create
foo/CVS
cvs add foo
- Populate
foo with your files
- Add the files:
cd foo
cvs add file1 file2
cvs commit
Deleting a file
- (optional)
Make sure that you do not have any uncommitted changes to the file:
cvs update foo.c
- Tell CVS you want to remove the file:
cvs delete -f foo.c
The -f option forces cvs to delete the file
from the current directory.
- Commit the changes, move the file to the CVS attic directory
cvs commit foo.c
This is covered in Chapter 9 of the CVS documentation.
If a file gets added without -kb, then you can fix it with
-
cvs admin -kb foo.class
-
cvs update -A foo.class
- Then copy in a good copy of the file from outside CVS.
-
cvs commit -m "Make it binary" foo.class
cvs remove -f foo.c will remove the file for you.
Renaming a file
The faq says:
4. How do I rename a file?
CVS does not offer a way to rename a file in a way that CVS can track
later. See Section 4B for more information.
Here is the best (to some, the only acceptable) way to get the effect
of renaming, while preserving the change log:
Copy the RCS (",v") file directly in the Repository.
cp $CVSROOT//,v $CVSROOT//,v
By duplicating the file, you will preserve the change history and the
ability to retrieve earlier revisions of the old file via the "-r
" or "-D " options to "checkout" and "update".
Remove the old file using CVS.
cd / rm
cvs remove
cvs commit
This will move the to the Attic associated with .
Retrieve and remove all the Tags from it.
By stripping off all the old Tags, "checkout -r" and "update -r" won't
retrieve revisions Tagged before the renaming.
cd /
cvs update
cvs log # Save the list of Tags
cvs tag -d
cvs tag -d
. . .
This technique can be used to rename files within one directory or
across different directories. You can apply this idea to directories
too, as long as you apply the above to each file and don't delete the
old directory.
Of course, you have to change your build system (e.g. Makefile) in
your to know about the name change.
Warning: Stripping the old tags from the copied file will allow "-r
" to do the right thing, but you will still have problems with
"-D " because there is no place to store the "deletion time".
See 5B.3 for more details.
Subversion
Information about Subversion, a version control system that was developed after CVS.
- Subversion Resources
-