[lug] reverting a bad commit in cvs

D. Stimits stimits at idcomm.com
Tue Apr 10 20:50:46 MDT 2001


"Holshouser, David" wrote:
> 
> Using cvs for revision control (imagine that) and had a 'bad' file get
> commited.
> How do you roll back to a specific, known good, revision in cvs so that
> anyone
> who does and update receives the good file?
> 
> --
> David Holshouser
> Engineer I
> Ball Aerospace & Technologies Corp.
> (303)939-5085  dholshou at ball.com
> 

The last time I needed to revert I used a simple technique from a cvs
book. Rather than simple erasing the commit, you tell it to update based
on tags, where the diff is taken NOT from:
current_code edit_code

But instead:
current_code prior_tag

This makes it consider the prior_tag as the edited version and will make
version history reflect the change from prior_tag, new_tag,
prior_tag-as-new_tag. It is the order of tags that accomplishes this.
the hello.c sample assumes that the old commit had version -j 1.3, and
this resulted in a new version -j 1.4. Here is the line:
cvs update -j 1.4 -j 1.3 hello.c

It mentions the use of the same syntax for diff to see if it is really
what you want to do, e.g.:
cvs diff -c -r 1.3 -r 1.4 hello.c

(just for kicks, reverse the 1.3 and 1.4 on the diff to see what the
reversal patch is).

You'll still need to do the commit, and maybe you'll want to add a tag.

Now I have to get back to fun, someone from 200.54.149.211 is trying to
get into my rpc and nfs.

D. Stimits, stimits at idcomm.com



More information about the LUG mailing list