I've taken another crack at this, that seems to be more workable.  I found an Ant Merge/Diff task that uses the same diffing tool that Wolfgang just checked into source: http://hydrogenline.com/ant/ant_md.html

I have an Ant task that looks at eXist mounted with WebDAV, and then does a merge from there to my Subversion checked out version.   I had an initial problem that all our XML is not indented, but the WebDAV was indenting.  I've added a patch that allows you to set in web.xml indent=off:


That patch is available here: https://sourceforge.net/tracker2/?func=detail&aid=2477527&group_id=17691&atid=317691

Now I can run ant merge:dev -Dwebdav=/Volumes/db/ and get all my changes.  I will paste the Ant target below.

If this looks like something that the committers would like, I'd be happy to document it further and supply patches for the ant_md libraries.

This isn't perfect, as if you have some pretty printed and some not, then it causes some merges, however it seems to be a step in the right direction. 


 <target name="merge:dev" description="Merge the changes between eXist db/history and Subversion">
    <echo message="-------------------------"/>
    <echo message="Merging Changes"/>
    <echo message="-------------------------"/>
    <echo message="WebDAV Directory: ${webdav}"/>
    <echo message=""/>
    <echo message="Pass in the mounted WebDAV with -Dwebdav=/Volumes/db"/>
    <fail message="You must pass in the path to the WebDAV dir using -Dwebdav=">
          <isset property="webdav"/>
    <available file="${webdir}" type="dir"
    <fail if="webdir.present" message="The path ${webdav} doesn't seem to exist."/>
    <merge todir="db/history"
        <fileset dir="${webdav}/history">
          <include name="**/*"/>
          <!-- these cause some out of memory errors -->
          <exclude name="documents/*"/>
          <!-- customize the excludes to eliminate files you aren't changing, can speed things up -->
          <exclude name="people/**"/>

On Dec 30, 2008, at 10:18 AM, Brad Clements wrote:

I have the same problem and am currently doing the same thing, store all .xq and xml files in file system for versioning and then bulk-import them into eXist.

I do not like this approach at all. It's a pain.

Last year I had tried using davfs to 'mount' an eXist collection, then svn checkout into the davfs mount. That did not work because eXist did not like document/collection names beginning with '.' (or maybe it was some other problem, either way it did not work).

My latest thought was creating a vfs driver for bazaar that would talk to eXist using xmlrpc or REST and allow it to be versioned, but I haven't gotten around to trying it.

Versioning is a problem for us, and it's not just a matter of having a history of changes, it needs to fit in with the system used by the rest of the code base (subversion or bazaar at the moment).

I had the same problem with Zope's ZODB and managed to get around that by using Shane Hathaways (now unsupported) Ape product. Not ideal, but functional.

Andrew Welch wrote:
Here's what we do....we keep all our code (XQuery/XSLT) and data (config files, images, xml documents, etc.) in a
separate directory structure, which is under SVN control and versioning.  We have an Ant build script (build.xml) which
uses eXist ant tasks to selectively deploy all the SVN versioned artefacts (code and data) directly to our eXist server
instance, with a single command.
I'm now approaching this problem myself - all xquery and xslt files
are stored in the database, but I really need to have them under
version control (svn).


Brad Clements,                bkc@murkworks.com    (315)268-1000
AOL-IM: BKClements
Exist-open mailing list

Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 | http://www.opensourceconnections.com