[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: finding changes on a branch
From: |
Dennis Jones |
Subject: |
Re: finding changes on a branch |
Date: |
Tue, 07 Aug 2007 07:13:24 GMT |
"Andy Howell" <AndyHowell@austin.rr.com> wrote in message
news:mailman.4465.1186444250.32220.bug-cvs@nongnu.org...
>I have a branch with subbranch:
>
> 1.66
> |
> +-> 1.66.2.1 - main branch
> ...
> 1.66.2.9
> |
> +-> 1.66.2.9.2.1 ( Branch 1.66.2.9.2 ) - sub-branch
> 1.66.2.10
> 1.66.2.11
>
> I need to apply the changes between 1.66.2.9 and 1.66.2.9.2.1 to
> 1.66.2.11. If I use the revision number, I can get a diff:
>
> cvs diff -r 1.66.2.9 -r 1.66.2.9.2.1 somefile.cpp
>
> cvs stat on somefile.cpp says:
>
> Sticky Tag: patch1 (branch: 1.66.2.9.2)
>
> If I try:
>
> cvs diff -r patch1 somefile.cpp
> or
> cvs diff -r patch1 -r HEAD somefile.cpp
>
> I don't get and changes.
>
> I can't figure out how to specify the revsions using the branch tags. I'm
> trying to express "take all the changes on my patch1 branch, and apply
> them to the head of the main branch".
You are using the wrong command. 'diff' only displays changes between
revisions; it does not apply them. You need to use the 'update' command
with the -j switch. For example, on your main branch (change to its
directory), do:
cvs up -j 1.66.2.9 -j 1.66.2.9.2.1 somefile.cpp
This will cause the changes in somefile.cpp between 1.66.2.9 and
1.66.2.9.2.1 to be applied to somefile.cpp in the current directory (which
should be your main branch).
If you want to do the same thing for all files in the branch, I hope you
have a symbolic tag that points to the branch's starting point (a branch tag
moves as files are modified, so you cannot use a branch tag as its starting
point). If you don't have a symbolic tag, then you are going to have a
difficult time applying all of the changes for all of the files using
individual revision numbers! The best thing to do is create a symbolic tag
using a time stamp (assuming you know when the branch was created). You can
do this by using the 'tag' or 'rtag' command with the -D switch. For
example:
cvs rtag -D 2007-08-01 15:00:00 branch_start module_name
Once you have a symbolic tag that references the branch's starting point,
you can do (from your main branch directory):
cvs up -j branch_start -j branch_tag
This will cause the changes in all files between branch_start (a symbolic
tag) and branch_tag (a branch tag) to be applied to those same files in the
current directory (which should be your main branch).
Does this make sense?
- Dennis