info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

am I misunderstanding what HEAD refers to?


From: Ted Stern
Subject: am I misunderstanding what HEAD refers to?
Date: Wed, 03 Oct 2007 11:59:46 -0700
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux)

Hi,

I'm wondering whether I'm completely misunderstanding CVS or if the
repository I'm working with has been screwed up somehow.

First, say that I have created a branch and am working there.


    cvs rtag BRANCHNAME_ROOT project
    cvs rtag -r BRANCHNAME_ROOT -b branchname project
    cvs checkout -r branchname -d project-branchname project
    cd project-branchname

Some changes have occurred in project's trunk, and I want to merge
them into the branch to make sure my stuff won't conflict:

    # First, keep track of the other end of the merge, on the trunk:
    cvs rtag BRANCHNAME_MERGE_HEAD project

    # Now, in project-branchname:
    cvs up -kk -j BRANCHNAME_ROOT -j BRANCHNAME_MERGE_HEAD

    # ... resolve any conflicts ...

    cvs commit -m "Merge from trunk, BRANCHNAME_ROOT -> BRANCHNAME_MERGE_HEAD"

Then I make some local branch changes and commit them.

At this point, I want to check to make sure no changes have gone into
the trunk between BRANCHNAME_MERGE_HEAD and right now.

So my first naive thought is to do a diff.  Note that I'm currently
sitting in my branchname sandbox:

    cvs diff -r BRANCHNAME_MERGE_HEAD -r HEAD 1>stdout 2>stderr

But what I see are differences between the BRANCHNAME_MERGE_HEAD tag
on the trunk and the latest changes on "branchname".  It's as if I
entered "branchname" instead of HEAD.  That's not what I want at all,
and not what I expected!

Does HEAD mean different things with different cvs commands?

One thing that works is to make another tag on the trunk:

    cvs rtag -F HEAD_TEMP project
    cvs diff -r BRANCHNAME_MERGE_HEAD -r HEAD_TEMP 1>stdout 2>stderr

But since this is a very large project, it can take several minutes to
make that temporary tag, and the whole point of this process is to
save the user some time by avoiding an extra merge from the trunk (+
conflict resolution + commit) unless it is absolutely necessary.

I suppose I could do a merge dryrun using the -n option:

    cvs -n up -kk -j BRANCHNAME_MERGE_HEAD -j HEAD 1>stdout 2>stderr

but I'm still confused why HEAD means different things for different
commands.

Is there any other way of specifying the trunk as a branch, using some
symbolic name?  Or is HEAD the only way?  When scripting, it would be
nice to be able to have the same syntax for operations with respect to
a parent branch, regardless of whether or not that parent branch is
the trunk or another branch.

Ted
-- 
 dodecatheon at gmail dot com
 Frango ut patefaciam -- I break so that I may reveal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]