Bob,

This basic problem was causing us fits for a long time.  I scoured the web for 
directory difference tools that could help.   There are a dozen or more tools 
out there, but none really works the way you want in a source code and/or 
deployment environment (believe it or not)  and can be run from the command 
line (e.g. from Nant).

So, I wrote my own directory differencing tool in .NET.  It's a command line 
program that will generate an XML file which contains a list the differences 
between two directories.  It filters out SVN control files.  Has filters to 
include any combination of  SAME, MODIFIED, DELETED or ADDED files or 
directories.  I then use the output of this tool (via Nant <exec> task) to copy 
selected differences from one location to another, and other used.  The XML 
output is parsed via the <xmllist> task.  The XML output has markers to make 
parsing easier via <xmllist>.

It is used most often to calculate the difference between two checked-out 
versions of the runtime image of a deployable software component and perform 
incremental updates without having to copy 1000's of files (esp. web sites).  
Can also be used to identify new and or deleted files when synchronizing 
directories.

It could be adapted to include and calculate file/directory dates for 
differencing as well.

Ken Parrish
Gomez, Inc.

From: Bob Archer [mailto:bob.arc...@amsi.com]
Sent: Wednesday, July 29, 2009 2:03 PM
To: nant-users@lists.sourceforge.net
Subject: [NAnt-users] creating a diff of two paths...

I see that in Nant the copy command only copies newer files. What I want to be 
able to do is copy files to a delta folder if they are newer rather than to the 
destination folder.

So, for example given two paths, MyPath/v0 and MyPath/v1 I want to copy all the 
files from MyPath/v1 that are newer than MyPath/v0 to MyPath/v1-Diff. Sort of a 
combination of the uptodate and copy tasks?

The only way I can think to do it now is to loop through each file and use an 
uptodate task in the loop. But, that seems like it would be quite slow.

Any ideas appreciated.

BOb
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to