[Top][All Lists]

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

Re: Updating branch w/ file added in trunk

From: Kaz Kylheku
Subject: Re: Updating branch w/ file added in trunk
Date: Thu, 11 Apr 2002 10:32:33 -0700 (PDT)

On 11 Apr 2002, Danial Islam wrote:

> Date: 11 Apr 2002 13:07:51 -0400
> From: Danial Islam <address@hidden>
> To: address@hidden
> Subject: [info-cvs] Updating branch w/ file added in trunk
> I have a branch called 'Patch1' which was created off the main trunk's
> module called 'test',
> e.g.
> cvs rtag -b Patch1 test
> cvs co -d Patch1_files -r Patch1 test
> So I am working on the Patch1 branch and make changes to it.  Then
> suddenly on the main trunk, a new file 'file.c' is added and thus all
> the branches need to be updated with this new file.  How will I do this?

Adding a file on a main trunk does not mean that all branches must also
get that file.  The main trunk is a separate, independent line of
development. That is why you made the branch in the first place, to
create a logical sequence of related changes which are free from
interference from the main trunk.

CVS does not support very well the idea of merging from the trunks to
branches, but it's possible. 

Simply go on the branch and do cvs update -j FOO -j BAR, where FOO and
BAR are two revisions on the main trunk: symbolic revisions, or date
specifications.  If revision FOO does not exist in a file, but BAR
does, then CVS will do the merge by locally adding the file, so that
file adds are handled.  Ideally, FOO and BAR are special tags that you
maintain yourself which keep track of what has been merged and to what
branch. There are various conventions for doing this. Tags based on
dates, a ``last merge'' tag that is pushed forward, etc.

In CVS, the intended model is that branches are temporary diversions which
are used to stabilize a release, or to develop an experimental feature.
Some version control systems support a model in which branches are
permanently diverged, equally important ``product lines'' that can be
kept in sync while maintaining their differences---differences that are
not intended to be integrated into one line. Under this second model,
you can merge from any branch to any branch.

This is possible in CVS, but since CVS doesn't track what has been
merged where, it's difficult and error prone. It basically requires
some intelligent scripting that gets it right.  Also, the revision data
structures (RCS files) used by CVS are optimized toward the main trunk.
Checking out branches requires the computation of zero or more deltas
rooted at the head revision of the main trunk. Branches that grow
longer and longer require more and more computation to check out.

The simpler ``fork and join'' branching model still requires manual
merge tracking, but it's easier to handle because each branch has one
logical place that it merges to.  So for a given branch, it's not
necessary to keep track of what has been merged to N other places.

reply via email to

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