I inherited a cvs repository in my new job. nobody knows when the
branch was last merged into the trunk. We also find no tags. Based
on other information in the build process we have a date that we
guess is the last merge.
Ouch.
Unfortunately, you are in for a lot of manual work to sort this out
(unless you're actually using CVSNT, and unless CVSNT has some
features that might help you - Arthur, over to you for that!).
Let me guess - the commit comments are either non-existent, or
otherwise useless, right?
A few questions: 1. Can I see when or what date a branch was
created?
Not directly, no. But by examining the dates in each file's log, you
can narrow it down to a date range.
2. can I use the name of the branch as a start point and a new
tag as the end point to see the changes or is that the same thing.
my thinking is the branch name will be the current snapshot of the
branch.
The name of a branch always refers to the latest revision on the
branch. CVS does not automatically label the branch start point.
At this point, though, it sounds like finding the branch point is the
least of your worries. You need to identify the revisions on the trunk
and on the branch where the last merge occurred.
I think the easiest thing to do is to use your best-guess date as a
starting point. Create a tag at the head of the trunk. Create two tags
in the branch, one at the head of the branch and one at the best-guess
date. Then, merge the changes into the trunk, and *BEFORE COMMITTING*
examine the changes VERY carefully, to ensure the merge has gone
correctly.
Command sequence would be:
cvs rtag TRUNK-PRE-MERGE-2011-10-30 module
cvs rtag -r yourbranchname yourbranchname-MERGE-2011-10-30 module
# cvs rtag cannot specify both -r (for the branch) and -D (for the date)
# so you have to use cvs tag, with the branch active
cd /your/working/directory
cvs update -r yourbranchname
cvs tag -D best-guess-date \
yourbranchname-MERGE-best-guess-date
# Now you have to handle files that may have been added on the
# branch after the best-guess date
# You can ignore the warnings about 'not moving tags'.
# Specifying rev 1.1.2.1 is safe, IN THIS INSTANCE - generally
# you would not specify numeric revisions. It's safe because:
# if the file existed in the trunk before the best guess date, then
# the previous command would have applied the tag, and it won't get
# moved. Otherwise (i.e. the file was added after the best guess date),
# since it's a new file, it
cvs tag -r1.1.2.1 yourbranchname-MERGE-best-guess-date
# Now you're ready to merge.
cvs update -A
cvs update -j yourbranchname-MERGE-best-guess-date \
-j yourbranchname-MERGE-2011-10-30
# examine, test, build, poke and prod at the code mercilessly until
you # are satisfied the merge is clean. Then:
cvs commit -m "Merged from branch yourbranchname"
cvs tag TRUNK-POST-MERGE-2011-10-30
- --
Jim Hyslop
Dreampossible: Better software. Simply. http://www.dreampossible.ca
Consulting * Mentoring * Training in
C/C++ * OOD * SW Development & Practices * Version Management