[darcs-users] Including another repos in a subdirectory

Lele Gaifax lele at nautilus.homeip.net
Mon Jul 19 11:15:36 UTC 2004

>>>>> "David" == David Roundy <droundy at abridgegame.org> writes:

    David> On Sun, Jul 18, 2004 at 07:12:12PM +0200, Lele Gaifax
    David> wrote:
    >> using darcs for several projects based on collections of
    >> various free software pieces, I'm facing a new problem:
    >> "absorbing" an external product from its own darcs repository.

    David> My general thought is that it is better not to require that
    David> the source of other (generally library) projects be
    David> contained within one's own source directory.  My feeling is
    David> that libraries should be kept as separate as possible from
    David> their use, with a separate build and "make install".

Yes, I can understand that, but in my usage that's not feasible: the
final tree represent a customized instance of "Plone", a CMS framework
base on Zope; such instance is, very roughly, something like

|-- Extensions
|-- Products
|   |-- ATContentTypes
|   |-- Archetypes
|   |-- BTreeFolder2
|   |-- CMFActionIcons
|   |-- CMFCalendar
|   |-- CMFCore
|   |-- CMFDefault
|   |-- ...
|-- bin
|-- etc

The hearth of everything is the Products directory: since every
product has its own repos and timeline, I found very handy to import
all of them under darcs. From there, any particular customization is
built starting from that repos and adding the specific new products.

    >> Given excellent darcs mv behaviour, I could of course just go
    >> and "darcs mv" everything in the right place, but I imagine
    >> this fails when new files were added by the upstream author.

    David> There is also a problem here if the upstream has a file
    David> with the same name as one in your root directory
    David> (e.g. Makefile or README).  This is alleviated if you don't
    David> keep much in your root directory, which I guess you might
    David> want to do anyways.

Yes, my root dir contains *only* subdirectories.

    >> I will suggests an upstream tree re-layout: having the project
    >> kept under a common "/ProductName/" tree would make everything
    >> work smooth...  but in general, isn't it possible to "redirect"
    >> in some way incoming patches down to a sub directory?

    David> What I would really recommend, would be to not have the
    David> upstream in your darcs repository at all.  You could
    David> instead have it in its own darcs repository, in a
    David> subdirectory of your repository (assuming you want it
    David> there).

Do you nesting various darcs repos into a larger one, like this

|-- _darcs
|-- Extensions
|-- Products
|   |-- ATContentTypes
|   |   |-- _darcs
|   |   |-- ...
|   |-- Archetypes
|   |   |-- _darcs
|   |   |-- ...

? Is this acceptable for darcs? I mean, running darcs in the top level
directory won't be crawling down the hierarchy, or disturbed by the
presence of other _darcs directories?

    David> Of course, this will only work if the two projects
    David> aren't very closely linked, since changes in one won't
    David> include changes in the other.  It also will mean that
    David> multiple "darcs get" command will be needed to get a copy
    David> of all the projects, and multiple "darcs pull"s will be
    David> needed to bring a directory up to date, but those could be
    David> scripted, or otherwise dealt with.  And you'd benefit in
    David> that darcs works more efficiently on smaller repositories.

Yes, of course, I can easily write a script that given a directory
looks for "_darcs" signature down the subtree and execute the
appropriate darcs command on the "closer" it finds. Then the only
hassle would be the initial "boostrap" of the instance...

thanks David,
ciao, lele.
nickname: Lele Gaifax	| Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas	| comincerò ad aver paura di chi mi copia.
email: lele at seldati.it	|		-- Fortunato Depero, 1929.

More information about the darcs-users mailing list