I am wondering how to get the last changes in a CVS module easily.
I think perhaps you could use the history command. Try something like:
cvs history -c -D 2012-04-01 -a
The above example shows all commits since the date specified (specified so the list is limited in length...).
-c
means commits,
-a
means all users.
Commits with the same timestamp and user are then obviously from the same commit. You can then proceed to read the log message of that commit with
cvs log -r <version> <file>
Just select one of the files from the specific commit. You find the version of that file in the history output as well. Finally, to see the diff I would use
cvs diff -D "<date 1>" -D "<date 2>"
Here, "date 1" and "date 2" should be a timestamp just before and just after the commit. Note that (as far as I am aware), this does not seem to work if you are working on a branch (??). That would be the topic for another question I suppose.
cvs log
will return all of them. Since you can't say "the last N revisions" (here, I can't even say cvs log HEAD
), there are two options:
Use
head -N
the get the N topmost lines (Unix or Cygwin only)Use a date and
cvs log -d DATE
Since the CVS implementation versions each file individually, I suppose you'd have to through each file and compare the commit timestamps to determine which one is the latest. Combine this with the fact that CVS does not support the concept of a commit set, so you can get a bunch of files with equal commit timestamp. So which one is the latest? Or maybe you could create a commit hook that writes to a log file and use that to determine the latest commit.
As you probably figured out, neither of these is a particularly giving path to choose. I strongly suggest that at the module-level you always compare against tags. Establish a software process that includes tagging the module when an important enough improvement is made (e.g. daily build, deployment to test environment, etc..) and then use the created tag as the comparison baseline.
You can accomplish diffing the latest changes against a tag by using
cvs rdiff
command without a working copy, orcvs diff
command at the top-level of a working copy
See the CVS documentation for complete reference.
© 2022 - 2024 — McMap. All rights reserved.