Rename file in CVS
I have checked a file temp.pl
but now I want to change into temp
.
I have tried cvs rename temp.pl temp
but it's not working .
How do I rename checked 开发者_如何转开发file in cvs
?
You cannot rename in CVS. You should do:
cp temp.pl temp
cvs add temp
cvs rm -f temp.pl
But you will lose file history. If you have file-level write access to the CVS repository, you can find file temp.pl,v there and rename it to temp,v - this will keep history.
CVS is inherently file-based (based on RCS), so cross-file operations are not supported.
Rename is not possible from the client side. There are however a couple of solutions for the brave by manipulating the repository files directly.
If you don't need the rename to be versioned you can simply rename the corresponding ,v-file in the repository.
If you do need the rename to be versioned you can create a copy of the ,v-file with the new name and then use cvs admin -s 'dead'
to mark all revisions in the new file prior to the rename as "dead" (meaning they won't be checked out when you request the older version but will still be listed by cvs log
). You should also cvs rm
the file with the old name and possibly force a new revision on the new name adding a commit message documenting the rename.
To rename a file while losing its revision history to date, try:
mv oldfile newfile
cvs remove oldfile
cvs add newfile
cvs commit -m "Renamed oldfile to newfile." oldfile newfile
If you don't want to lose its revision history, first migrate to something other than CVS, and then rename the file.
精彩评论