[cvsnt] Re: Same file in two places?

Andreas Tscharner andreas.tscharner at metromec.ch
Wed May 26 07:11:40 BST 2004


Hello,

Harrison, Andrew wrote:
> Is it possible to have the same source file in two places within a module?
> 
> myproject\
>                submodule1\
>                                   file1.c
>                                   include.h
>                submodule2\
>                                   file2.c
>                                   include.h
> 
> So here the two files myproject\submodule1\include.h and
> myproject\submodule2\include.h are infact the same file. Any modification to
> one will also modify the other.

I suggest a third directory, let's call it common\. There you put the 
files that are needed by both projects. After that you have:

submodule1\
   file1.c

submodule2\
   file2.c

common\
   include.h


Now, you modify the modules file from the CVSROOT (checkout CVSROOT) 
like this:

submodule1		submodule1 &common
submodule2		submodule2 &common


This gives you at the checkout of the submodules the following structure:

submodule1\
   file1.c
common\
   include.h

and

submodule2\
   file2.c
common\
   include.h


where include.h is in fact the same file and changes in one submodule 
affects the file in the other as well (I am at the moment not quite 
sure, if the directory stucture is in fact as described above; common\ 
may be a subdirectory of the submodule directory).

For further information, have a look at the documentation of the modules 
file: http://www.cvsnt.org/manual/Administrative-files.html#modules

In newer versions of CVSNT, there is also a new file called modules2, 
but I don't know the exact syntax. Search in the mailinglist archive for 
more information.

Best regards
	Andreas
-- 
Andreas Tscharner                          andreas.tscharner at metromec.ch
------------------------------------------------------------------------
Real coders don't comment their code. It was hard to write, it should be
hard to understand.                 -- from the Linux Kernel Mailinglist



More information about the cvsnt mailing list