The simple answer is to run the merge from the branch to the trunk again,
but in reverse.
First, say you decide to put a new feature into development in its own
branch.
The branch is called 'FEATURE-1'
o cvs tag -b FEATURE-1
To easily back it out later, you also need a regular tag on its parent
(usualy the trunk)
o cvs tag FEATURE-1-fork
Later, when you are ready to migrate the changes from the branch to the
trunk (or parent branch) you would:
o tag the branch with a non-branch tag so that if more changes come
in this branch, the merge of those back into the trunk will be easier. 'cvs
tag FEATURE-1-marker-1'
o 'cvs update -A' to return the local code to the trunk
o tag the trunk with a pre-merge marker 'cvs tag
premerge-FEATURE-1-marker1'
o 'cvs update -j FEATURE-1' if this was the first merge from
this branch to the trunk OR
o 'cvs update -j FEATURE-1-marker1 -j FEATURE-1-marker2' to
bring in just the new changes (for regular migrations from branch to parent
after the first)
o check the changes and (eventually) run a 'cvs commit'
o tag the trunk with some kind of post-merge marker 'cvs tag
merged-FEATURE-1-marker1' or something. This step is not technically
necessary but way handy for using as a baseline for reporting (when did we
merge it?) and diffing forwards and backwards through the codebase (or even
across branches)
Then the case you need, undoing a change:
o 'cvs update -A' to set the state to the truck
o 'cvs update -j FEATURE-1 -j FEATURE-1-fork' if you want to
undo the entire branch OR
o 'cvs update -j FEATURE-1-marker2 -j FEATURE-1-marker-1' if
you just want to undo a subsction of stuff from the branch.
Notes:
o The order of the -j's is important (newer to older reverses a
change, older to newer brings them in)
o AFAIK easily undoing a branch merge requires that the trunk get a
normal tag created at the same time the branch is created. Without them you
are probably going to have to determine the date of the branch and use that
instead, or go back and create a tag for that date.
o This can also work for branch-of-a-branch (replace 'cvs update -A'
with 'cvs update -r parentbranch' etc)
----- Original Message -----
From: "Troy Hall" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 29, 2000 5:30 PM
Subject: Reverting user changes
> Steps
> 1. Branched the trunk.
> 2. Developer works like heck to incorporate his developed code into
> the branch.
> 3. His code was not good enough (after merging it into the branch), so
> his functionality must be withdrawn from all the files he touched.
>
> Is there a "CVS way" to take this developer's code out of the branch?
> If not, how would you prevent this problem from happening in the future?
>
>
>
>