[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: Sub modules? - svn:externals + branching

From: <andy.glew_at_amd.com>
Date: 2004-04-29 23:22:52 CEST

> This allowed us to manage shared files across multiple
> servers without having to have multiple copys of the files.

Using svn:externals seems to be the recommended way.

E.g. I maintain several fairly large libraries,
one of which looks like

   * libag
      *libag/test
         * libag/test.hh
      * libag/fmt
         * libag/fmt.hh
      * libag/bitpattern
         * libag/bitpattern/bitpattern.hh
      * libag/uarchlib
         * libag/uarchlib/bpred
            * libag/uarchlib/bpred/{Smith,McFarling,...}-bpred.hh
      etc.

There are, of course, tests in each subdir.
And nearly everyone uses test.hh.

I like each of directories to be freestanding,
capable of being checked out and tests run individually.

Therefore, it looks like I am heading - I have started
to do the following: propsetting svn:externals in every
module to include all of the modules they depend on
(but to include modules they do not depend on).
By convention, I but these in a subdiectory "import".

When checked out, this yields a directory tree that looks
like this:

   * libag
      *libag/test
         * libag/test.hh
      * libag/fmt
         * libag/fmt.hh
            EXTERNAL: import/libag/test
      * libag/bitpattern
         * libag/bitpattern/bitpattern.hh
            EXTERNAL: import/libag/test
            EXTERNAL: import/libag/fmt
      * libag/uarchlib
         * libag/uarchlib/bpred
            * libag/uarchlib/bpred/{Smith,McFarling,...}-bpred.hh
               EXTERNAL: import/libag/test
               EXTERNAL: import/libag/fmt
               EXTERNAL: import/libag/bitpattern

You get the picture...

Each of the import subtrees in the workspace is separate files,
although they are all "linked" through the Subversion repository.
If an edit is made to one, svn update will propagae it everywhere
else [*].

If filespace is cheap, not too much of a problem.
I think that you could see how a deeply layered system
could have quadratic explosion in the filespace required
for the checked out external dependencies.
Filespace is not that cheap.

Fortunately, most of my libraries do not depend on each other,
so there is not as much duplication of checked out files
in the workspace as there might be.

---
Now, my real question:
The above seems to work, profligate as it may be with filespace.
I do seem to have minor problems relating to divergences
between the external subtrees.  These divergences occur for
two reasons:
   (1) I have made an edit to one such tree, but not propagated
       it everywhere.  The workaround is obvious: checkin, 
       and then cvs update everywhere.  Nevertheless, it leads
       to fun bugs.
   (2) Worse, when one import subtree has branched but the others
       have not.   Typically, all of the instances of a library
       module are required to be consistent.  One module may only
       work with a branched version of a librray; other modules
       will work with either the branched or non-branched version.
I haven't found a good way to manage the branching case.
I am thinking of having my checkout wrappers check out only a
single version of the imported libraries, creating symlinks
as necessary.
I.e. instead of
   * libag
      *libag/test
         * libag/test.hh
      * libag/fmt
         * libag/fmt.hh
            EXTERNAL: import/libag/test
      * libag/bitpattern
         * libag/bitpattern/bitpattern.hh
            EXTERNAL: import/libag/test
            EXTERNAL: import/libag/fmt
      * libag/uarchlib
         * libag/uarchlib/bpred
            * libag/uarchlib/bpred/{Smith,McFarling,...}-bpred.hh
               EXTERNAL: import/libag/test
               EXTERNAL: import/libag/fmt
               EXTERNAL: import/libag/bitpattern
when you check ot libag you may get the tree without any 
imports/externals; the import subtrees will be symlinkd,
But if you check out just a submodule, you get the 
imports not as symlinks but as real files:
E.g/. checking out bitpattern in isolation:
      * libag/bitpattern
         * libag/bitpattern/bitpattern.hh
            EXTERNAL: import/libag/test
            EXTERNAL: import/libag/fmt
Q: has anyone done something like this? 
Hints/scriprs to share?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Apr 29 23:25:25 2004

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.