[cvsnt] Re: Regresssion and branches in the current sand box?

Glen Starrett grstarrett at cox.net
Tue Aug 24 04:36:15 BST 2004


Siegfried Heintze wrote:

> I get confused when I use 
> 
> cvs update -r <branch or revision>
> 
> I get the files I want but when I try to edit and commit my changes, I get
> strange messages.
> 
> I found I can recover with "cvs update -A", but then I get the most recent
> stuff again.
> 
> What happens if 
> (1) my current revision of a certain file is 1.6 and I want to abandon 1.6
> and 1.5 and start editing with 1.4 to create 1.7? What are the commands for
> this? Do I have to create a new sandbox? 

To revert the current version back to an older state:
cvs up -j HEAD -j 1.4
(the order of the -j's is important)

> 
> I suppose I could use "cvs update -r 1.4", load this into the editor, then
> do "cvs update -A", then finish editing and write the contents of the editor
> buffer to disk and "cvs commit". Hmmm... It seems there should be a better
> way.

Or just rename the old one:
cvs up -r 1.4 foo.c
mv foo.c foo.c.1.4
cvs up -A
cp foo.c.1.4 foo.c

...or check it out to stdout and redirect it back onto the real file:
cvs co -p foo.c > foo.c
(I think that works, never tried it)

> 
> (2) I have created a new branch and want to switch back and forth between
> branches. After reading "Essential CVS", it looks like I have to check out a
> new sand box for each branch I want to edit. Is this correct? 

No, unless you want to edit them at the same time.
cvs up -CAdP -r mybranch

> 
> I was hoping it would just write the current branch to the current
> directory.
> 
> Incidentally, does "cvs update -r " accept a revision number or a branch? It
> looks like it does from the documentation.

Both.  Also a commit id, if you want to use one of those.  Straight from 
"cvs -H up":

     -r rev  Update using specified revision/tag (is sticky).


> 
> I suppose I could always release the current sandbox, check out the other
> sandbox in the same directory, edit it, commit, release and checkout the
> first branch again. Hmm.....
>   Thanks,
>         Siegfried
> 


-- 
Glen Starrett



More information about the cvsnt mailing list