Discussion:
A question about merging or figuring out merge points
KM
2011-10-27 17:27:20 UTC
Permalink
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. 
 
A few questions:
1.  Can I see when or what date a branch was created?
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.
 
If i am on the wrong track how can I see what has already been merged, or can't I?
Sorry for bugging you.  The guide doesn't really have this much detail.
 
Thx
KM
Arthur Barrett
2011-10-27 22:17:19 UTC
Permalink
KM,

What version of CVS? What operating system?
Post by KM
Sorry for bugging you.  The guide doesn't really have this
much detail.
What guide are you using? The reference manual is a reference - it's designed for people who already know what they are doing. CVS is a large and complex system - noone would administer a clearcase repository without spending tens if not hundreds of thousands of dollars on training. At least buy some books about CVS from Amazon (or whoever) - there are hundreds including 'all about cvs' which I had a hand in writing.
Post by KM
1.  Can I see when or what date a branch was created?
If you are using CVSNT 2.x and have audit enabled, yes. CVSNT is NoT CVS though - so contact the vendor for support.

If you are using CVS 1.x or CVSNT 2.x and have 'history' enabled, yes - use 'cvs history'.
Post by KM
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. 
The branch-name refers to the end (HEAD) of the branch not the beginning of the branch.
Post by KM
 
how can I see what has already been merged, or can't I?
If you are using CVSNT 2.x - yes - the mergepoints will tell you what has already been merged. Subsequent mergepoint merges automatically only merge the changes since the previous merge.

Regards,


Arthur
Gary Funck
2011-10-28 03:38:27 UTC
Permalink
On 10/28/11 09:17:19, Arthur Barrett wrote:
[...]
Post by Arthur Barrett
If you are using CVS 1.x or CVSNT 2.x and have 'history' enabled, yes - use 'cvs history'.
In addition, you might have a look at cv2cl (CVS to ChangeLog).
http://www.red-bean.com/cvs2cl/
(cvs2cl is typically available as an installable package under Linux.)

These options in particular may help you understand the timing and
impact of a particular branch.

-F *BRANCH*, --follow *BRANCH*
Show only revisions on or ancestral to *BRANCH*.

--follow-only *BRANCH*
Like --follow, but sub-branches are not followed.

--no-ancestors
When using -F, only track changes since the *BRANCH* started.
Jim Hyslop
2011-10-30 17:32:54 UTC
Permalink
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

Loading...