info-cvs
[Top][All Lists]
Advanced

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

Re: cvs add question


From: Eric Siegerman
Subject: Re: cvs add question
Date: Fri, 13 Jul 2001 13:32:19 -0400
User-agent: Mutt/1.2.5i

On Thu, Jul 12, 2001 at 07:18:13PM -0500, John Lash wrote:
> I have extracted a directory from CVS using a non-branch label off the trunk 
> of 
> the source tree.
>       cvs checkout -r MYLABEL foo
> I want to add a file in that directory but I want to add it on a branch 
> (MYBRANCH).

The usual way (and by far the best) is to branch the entire
project, not just the one file:
        cvs tag -b -rMYLABEL MYBRANCH

Then put your sandbox "onto the branch":
        cvs update -rMYBRANCH

Then add and commit the file as usual:
        cvs add newfile.C
        cvs commit

Finally, once you're done working on the branch, go back to the
mainline:
        cvs update -A

Why is this better?  Because:
  - If you later need to make more changes on the same branch,
    you won't have to figure out whether you already branched the
    file in question (you'll know it's been done).  You'll be able
    to just make your changes and commit them, without the constant
    distraction of keeping the revision-control stuff straight.
  - When it comes time to merge the branch back into the
    mainline, CVS will be able to help you more effectively.

> I eventually got the file added to the branch but had to temporarily modify 
> the 
> CVS/Tag file to make it contain "TMYBRANCH",

Which is one of things the "cvs update -rMYBRANCH" step does.

> then flip it back to the original 
> "NMYLABEL".

Which is one of the things "cvs update -A" does.

> yuck.

Indeed!

> I'm curious if there is a better/safer/saner way to do it? Also, are there 
> negative side effects of using this trick.

See above, on both counts :-)

> And finally, has anybody considered 
> allowing use of the -r option on the add command?

I'd argue against it.  You're trying to use CVS in a rather
nonstandard and ugly way.  I'd prefer to encourage you to use it
as it was intended to be used.

> Strangely enough, there are reasons for doing all this which I can explain if 
> anybody cares.

If they're compelling reasons not to do as I've suggested, an
explanation might help us to come up with a (perhaps still
nonstandard, but less ugly) way to do what you need.

--

|  | /\
|-_|/  >   Eric Siegerman, Toronto, Ont.        address@hidden
|  |  /
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea.
        - RFC 1925 (quoting an unnamed source)



reply via email to

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