CVS revision numbers
Asked Answered
P

4

6

When I do a cvs status of my project I get different revision numbers for different files. What is happening here? Should not all the files have the same revision number?

Pupa answered 5/6, 2009 at 11:39 Comment(0)
T
9

The CVS revision number reflects how many times that file has been changed. If you want something consistent across a project you'll need to use cvs tag after committing to give everything a consistent label.

Thorn answered 5/6, 2009 at 11:43 Comment(4)
Coming from SVN had a harrowing experience with CVS today. I had to revert my project back to a certain state. So I checked the revision no of one of the files in the commit I wanted to revert to and tried to update my project to that revision using update -r command. Everything got screwed. Then I saw the time of the commit and updated the project to that time using update -D. Is this the best way to do it or is there any other method?Pupa
Yes, there is another method. It's called tagging. If you're using CVSNT there's also commit IDs (auto-generated) and bug IDs (user-specified).Eade
explanation of CVS numbers: network-theory.co.uk/docs/cvsmanual/Revisionnumbers.htmlBespoke
@Abhi: If there's a state you think you might want to revert to, tag it. Check everything out, get it the way you want, and "cvs tag". The next best thing is to go by time with -D, as you tried, but you can get an inconsistent state. If somebody was doing a large commit at that time, you may only pick up some of it. Using "cvs rtag" instead of "cvs tag" has exactly the same problem.Ushijima
C
6

no. cvs does not have a single revision number like more modern version control systems. Each file has its own separate version. If there is any way you can move to another version control system like subversion, mercurial, git...do it.

Champlin answered 5/6, 2009 at 11:43 Comment(2)
So it is different from SVN where each commit changes the revision no of the head?Pupa
"The head" does not have a specific revision number in CVS. HEAD is just a kind of virtual tag that identifies the latest revision of each file on its designated default branch (typically the trunk).Eade
P
1

CVS doesn't have global revision numbers, they are per-file. (In fact, CVS doesn't even have atomic commits)

Pellagra answered 5/6, 2009 at 11:43 Comment(1)
CVSNT does have atomic commits, though.Eade
U
1

CVS was originally a set of scripts over the file-oriented RCS, and it never escaped its history. A CVS repository is a collection of RCS files arranged in the directory structure you want when it's checked out, plus some lock directories. Remember that and you'll understand (and maybe be able to anticipate) a lot of CVS idiosyncracies. (Later VCS have had the idea of directories built in, as well as things like file continuity across renames.)

The CVS idea of a global state is a tag, which has to be applied manually. This is done by tagging each and every RCS file. It's also possible to get a copy of the repository at a given time, but this is not necessarily consistent, as large commits are not necessarily atomic.

So, no, the CVS revision of a file is the RCS revision in the repository, and has nothing to do with any other revision number. Don't sweat the revision numbers.

Ushijima answered 2/7, 2009 at 15:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.