Assuming *I* understood you correctly, my preferred method is simply to define two
modules. I much prefer to reserve branches and tags for revision tracking.
so I would define 3 directories inside projectdir:
machine1
machine2
common
and in the modules file (you may have to double-check my syntax):
machine1mod projectdir machine1 common
machine2mod projectdir machine2 common
Then, assuming I got that syntax correct, when you check out machine1mod, you
should get:
projectdir/machine1
projectdir/common
and for machine2mod:
projectdir/machine2
projectdir/common
If you play with the module definitions (aliai and ampersands and -d...), you can
do some tricky stuff to either put the two modules under different directories to
avoid checkout conflicts or (I think) set them up to purposely overlap the common
directory if both modules are checked out, but that's more a matter of how you like
to work. If you like having the machine 1 and machine 2 code checked out in the
same disk space on different branches at the same time you might want to avoid the
directory overlap or be aware that you'll have to rename the modules on checkout to
make sure each module has the correct version of the common code.
The ifdef stuff Michael Gersten mentioned may still be appropriate, but I
personally wouldn't try and integrate that with CVS further than storing the
information in the right place or maybe using a trigger to write the correct
machine.h file on checkout of the module. I suppose Michael's method does have the
advantage of condensing to a single step, but a trigger script which used 'uname'
or 'ver' or whatever the Windows equivalent of 'umame' is would have the same
effect and the user doesn't need to know how the machine they are compiling on
relates to CVS. They only need to know their project name. Of course, this method
precludes splitting the machine1 and machine2 code between the modules - it relies
on a single module and the ifdefs in the code.
Derek R. Price
CVS Solutions Architect
303.554.8291
[EMAIL PROTECTED]
http://alumni.engin.umich.edu/~oberon/resume.html
--
This sentance contains threee errors.
[EMAIL PROTECTED] wrote:
> I need some help to decide whether to use a branch or whether some other method
> is more appropriate.
>
> I'm a relative newcomer to CVS. I am using it to control a project that consists
> of two Windows DLLs (I'm working with Microsoft Developer Studio and WinCVS,
> with the repository on a UNIX box). Call them main.dll and site.dll.
>
> main.dll is core code common to all installations of the software. site.dll is
> installation-specific.
>
> I want to know what is the best way to manage this project in CVS. My initial
> thought was to create a branch for each different installation. So for the A
> site, I would choose the A branch, edit the code for site.dll and rebuild the
> project.
>
> I hit an immediate snag when CVS didn't appear to allow me to specify which
> files were to be in the branch. Further reading made me think that perhaps this
> is not what branches are intended for. A branch appears to be a way of creating
> a copy of an entire project isolated from the main trunk, which at a later date
> might merge back with the main trunk. I want to separate off a couple of files
> from the project and make several different versions of these files, the
> versions being related as brothers rather than as father, son, grandson, and
> then choose which version I have checked out along with the common code so I can
> build the appropriate version of site.dll.
>
> Everything is in one module at present. Would I be better off if I had put the
> DLLs in separate modules? If so, what would I do with the source files that are
> common to both DLLs? If I need to split this into two modules, can I do this
> easily without losing the version histories?
>
> I would be very grateful for all suggestions that I receive.
>
> Ian Goldby
>
> **********************************************************************
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
>
> This footnote also confirms that this email message has been swept
> for the presence of computer viruses.
>
> Power Technology Centre, Ratcliffe-on-Soar,
> Nottingham, NG11 0EE, UK
> Tel: +44 (0)115 936 2000
> http://www.powertech.co.uk
> **********************************************************************