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

Working in partially versioned directories

From: Tino Schwarze <subversion.lists_at_tisc.de>
Date: Tue, 23 Mar 2010 15:01:04 +0100

Hi there,

We are currently planning migration from CVS to SVN and I've come across
a rather fundamental issue for our development workflow.

We have an application which consists of multiple modules which are
packaged together, then installed into a Web-application layout. That
is: The repository layout differs from the final installed application
layout (files are distributed across the whole installation at various
places).

For example, consider the following repository structure (I'm making
this up for simplicity):

/trunk/module1/jsp/something.jsp
/trunk/module1/java/com/c4u/module1/Someclass.java
/trunk/module1/sql/create_scripts/sometable.sql
/trunk/module2/jsp/anotherthing.jsp
/trunk/module2/java/com/c4u/module2/Anotherclass.java
/trunk/module2/sql/create_scripts/anothertable.sql

After repackaging and installing, these files are arranged like this:

webroot/jsp/c4u/module1/something.jsp
webroot/jsp/c4u/module2/anotherthing.jsp
webroot/WEB-INF/classes/com/c4u/module1/Someclass.java
webroot/WEB-INF/classes/com/c4u/module2/Anotherclass.java
sql/c4u/module1/create_scripts/sometable.sql
sql/c4u/module2/create_scripts/anothertable.sql

That is, each modules contents are distributed across the installation
and there are a lot of intermediate directories which are not under
version control. Of course, we want to develop within the installed
application. With CVS, we used a script which scans the whole
application for CVS directories, then creates symlinks for all
directories under version control like this:

devel/module1_+_jsp -> ../webroot/jsp/c4u/module1/
devel/module1_+_java_+_com_+_c4u_+_module1 -> ../webroot/WEB-INF/classes/com/c4u/module1/
devel/module1_+_sql -> ../sql/c4u/module1/
devel/module2_+_jsp -> ../webroot/jsp/c4u/module2/
devel/module2_+_java_+_com_+_c4u_+_module2 -> ../webroot/WEB-INF/classes/com/c4u/module2/
devel/module2_+_sql -> ../sql/c4u/module2/

Then we were able to perform CVS commands within the devel/ subdirectory.
For Eclipse integration, someone wrote an Ant script which creates some
bogus CVS directories so the Eclipse plugin is happy and recognises the
project as version controlled.

Now we tested the above setup with Subversion and it only partially
works:
.../devel> svn status
svn: warning: '.' is not a working copy [this is expected]
.../devel> svn status *
[... output as expected ...]
.../devel> svn up *
At revision 85329.
At revision 85329.
At revision 85329.
[...]
[of course, this is not atomic anymore, but it will be visible if the
revision numer is changing inbetween]

.../devel> svn diff *
svn: '.' is not a working copy
.../devel> svn diff module2_+_java_+_com_+_c4u_+_module2
svn: '.' is not a working copy
.../devel> svn diff `readlink module2_+_java_+_com_+_c4u_+_module2`
[works]

After all, committing changes from more than one directory will not work
because SVN seems to look at the common base directory (above webroot/)
which is, of course, not version controlled.

It's even difficult to ask a sensible question... Let's try this one:
How are people developing modularized web applications where files come
from different locations within the same repository?
Or: Is there a way to get SVN to handle a directory structure with some
directories not version controlled (the topmost directory being the most
important)? Maybe there is a similar hack like the above mentioned CVS
hack - e.g. create dummy .svn/entries files which just make SVN look
deeper into the tree.

Thanks!

Tino.

-- 
"What we nourish flourishes." - "Was wir nähren erblüht."
www.lichtkreis-chemnitz.de
www.tisc.de
Received on 2010-03-23 15:01:34 CET

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