[Top][All Lists]

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

Re: Ignore local changes?

From: Eric Siegerman
Subject: Re: Ignore local changes?
Date: Wed, 2 Apr 2003 13:44:00 -0500
User-agent: Mutt/1.2.5i

On Wed, Apr 02, 2003 at 12:28:48AM -0600, Wade Williams wrote:
> But is there a way I can tell CVS - always update this file on an 
> update, but ignore my changes on a commit?

No, but you can get part-way there, by explicitly updating to
the HEAD revision of the file.  Find out what the HEAD revision
is (for the sake of argument, say it's 1.4), and type:
        cvs update -r1.4 myfile

Then, attempts to commit the file will die with this message:
      cvs commit: sticky tag `1.4' for file `myfile' is not a branch
      cvs [commit aborted]: correct above errors first!
It doesn't do what you want automatically, but at least it gives
you a noisy reminder to do it manually, and prevents CVS from
doing the wrong thing if you forget.

Unfortunately, updates will not update/merge the file; they'll
update everything else and silently leave that one alone.  You'll
have to remember to periodically update it yourself:
        # Merge changes
        cvs update -A myfile
        # Don't change the file, but pin it at the new HEAD rev.
        cvs update -r<new-head-rev> myfile

That's the cost of using a sticky revision tag for its
usually-annoying side effect, rather than for its intended
purpose :-)

CVS should probably print a warning in this case, but it doesn't.

So this trick only gives you one of your two requirements, but
arguably the more important one.  The mistake it prevents you
from making is the one that would affect other peoples' work,
while the mistake it still permits will affect only your own.


|  | /\
|-_|/  >   Eric Siegerman, Toronto, Ont.        address@hidden
|  |  /
A distributed system is one on which I cannot get any work done,
because a machine I have never heard of has crashed.
        - Leslie Lamport

reply via email to

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