- •Overview
- •What is CVS?
- •What is CVS not?
- •A sample session
- •Getting the source
- •Committing your changes
- •Cleaning up
- •The Repository
- •Telling CVS where your repository is
- •How data is stored in the repository
- •File permissions
- •The attic
- •The CVS directory in the repository
- •CVS locks in the repository
- •How data is stored in the working directory
- •Multiple repositories
- •Creating a repository
- •Backing up a repository
- •Moving a repository
- •Remote repositories
- •Server requirements
- •Connecting with rsh
- •Direct connection with password authentication
- •Setting up the server for password authentication
- •Using the client with password authentication
- •Security considerations with password authentication
- •Direct connection with GSSAPI
- •Direct connection with Kerberos
- •Connecting with fork
- •Read-only repository access
- •Temporary directories for the server
- •Starting a project with CVS
- •Creating Files From Other Version Control Systems
- •Creating a directory tree from scratch
- •Revisions
- •Revision numbers
- •Versions, revisions and releases
- •Assigning revisions
- •Specifying what to tag from the working directory
- •Specifying what to tag by date or revision
- •Deleting, moving, and renaming tags
- •Sticky tags
- •Branching and merging
- •What branches are good for
- •Creating a branch
- •Accessing branches
- •Branches and revisions
- •Magic branch numbers
- •Merging an entire branch
- •Merging from a branch several times
- •Merging and keywords
- •Recursive behavior
- •Removing directories
- •The Normal way to Rename
- •Moving and renaming directories
- •History browsing
- •Log messages
- •The history database
- •Multiple developers
- •File status
- •Informing others about commits
- •Several developers simultaneously attempting to run CVS
- •Telling CVS to notify you
- •Information about who is watching and editing
- •Using watches with old versions of CVS
- •Choosing between reserved or unreserved checkouts
- •Revision management
- •When to commit?
- •Keyword substitution
- •Keyword List
- •Using keywords
- •Avoiding substitution
- •Substitution modes
- •Problems with the $Log$ keyword.
- •Tracking third-party sources
- •Updating with the import command
- •Reverting to the latest vendor release
- •How to handle keyword substitution with cvs import
- •Multiple vendor branches
- •How your build system interacts with CVS
- •Special Files
- •Index
Chapter 7: Adding, removing, and renaming files and directories |
57 |
$ cd ~/dir |
|
$ rm old |
|
$ cvs remove old |
|
$ cvs commit old |
|
# Remove all tags from new |
|
$ cvs update new |
|
$ cvs log new |
# Remember the non-branch tag names |
$ cvs tag -d tag1 new |
|
$ cvs tag -d tag2 new |
|
... |
|
By removing the tags you will be able to check out old revisions. Advantages:
• Checking out old revisions works correctly, as long as you use ‘-rtag’ and not ‘-Ddate’ to retrieve the revisions.
•The log of changes is maintained intact.
•The revision numbers are not a ected.
Disadvantages:
• You cannot easily see the history of the file across the rename.
7.5 Moving and renaming directories
The normal way to rename or move a directory is to rename or move each file within it as described in Section 7.4.1 [Outside], page 56. Then check out with the ‘-P’ option, as described in Section 7.3 [Removing directories], page 55.
If you really want to hack the repository to rename or delete a directory in the repository, you can do it like this:
1.Inform everyone who has a checked out copy of the directory that the directory will be renamed. They should commit all their changes in all their copies of the project containing the directory to be removed, and remove all their working copies of said project, before you take the steps below.
2.Rename the directory inside the repository.
$ cd $CVSROOT/parent-dir
$mv old-dir new-dir
3.Fix the cvs administrative files, if necessary (for instance if you renamed an entire module).
4.Tell everyone that they can check out again and continue working.
If someone had a working copy the cvs commands will cease to work for him, until he removes the directory that disappeared inside the repository.
It is almost always better to move the files in the directory instead of moving the directory. If you move the directory you are unlikely to be able to retrieve old releases correctly, since they probably depend on the name of the directories.
58 |
CVS—Concurrent Versions System v1.11.21 |