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

Shared/Common files in SVN

From: Marco Burato <marco.burato_at_gerelettronica.com>
Date: Wed, 23 Feb 2011 14:04:15 +0100

Hi,

i'd like to propose a new feature/improvement to SVN.
Some users have projects that share some files, usually the layout would
be something like this:
\Common
\Project1
\Project2
\Project3

When working on a project, the developer needs to checkout the Project
directory and also the Common directory,
which contains the files shared between the projects.

This can't be directly handled by SVN in a single checkout, there are
workarounds but they have limitations:

1) Double checkout
Using this method the developer have to checkout the Project dir and the
Common dir separately.
This means that they also have to ensure they're checking out the same
revision from both, and they also need to handle commit/updates
between them. In other words they must do everything manually with the
risk of doing something wrong with revisions.

2) Files / library copy
This consists on making copy of the shared files in the project dir, or
make a library for them and copy it to the project directory
The library approach seems to be the the best solution but there are
situations in which this can't be done, for example if a shared file is
an header. Also, if the shared files must be edited this means the
developer have to checkout the Common dir any way and edit the project
to use it while testing, and finally to rebuild the library and copy it
to the project.

3) Externals
The externals method is near the solution, it consists in adding an
external directory inside the project which points to the Common dir.
The main problem is that externals are not in sync with the main
checkout, they refer to HEAD revision by default, or a specific revision.
To checkout a past revision of the project the only solution is to use a
specific revision in externals. This means that after committing a
change to the common files the externals revision in the project must be
manually updated.

Possible solutions:

1) Improved sparse directories
Sparse directories would be a solution, but they only work varying the
depth of the checkout. If we could add a property or something to
specify which directories must be included in the checkout than it would
work as needed.

2) Improved externals
Externals problem is that they don't follow the revision of their
parent. By specifying an option like -r BASE in the svn:externals
property it would be possible to do so, solving the problem.

I'd like to hear some considerations by experienced users, to understand
if there are other solutions or some drawbacks in the proposed ones.

References:

http://stackoverflow.com/questions/135361/subversion-and-shared-files-across-repositories-projects
http://stackoverflow.com/questions/4917328/svn-shared-checkout-folders
http://stackoverflow.com/questions/1411681/source-control-products-that-support-linked-shared-files
http://stackoverflow.com/questions/249787/sharing-files-in-svn
http://stackoverflow.com/questions/909598/how-the-shared-files-linked-files-in-vss-can-be-migrated-to-a-subversion-reposi

http://svn.haxx.se/users/archive-2005-02/1135.shtml

-- 
Marco Burato
Received on 2011-02-23 15:26:22 CET

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.