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

RE: Ant Task and Diff Export

From: Reedick, Andrew <Andrew.Reedick_at_BellSouth.com>
Date: 2006-08-09 16:24:22 CEST

> -----Original Message-----
> From: Rob Wilkerson [mailto:r.d.wilkerson@gmail.com]
>
> 1. Is it possible to export (not checkout) the diff between two
> global revision numbers?
 
Out of the box, no.

Here's a (lightly tested) script that will list the delta between 2
revision numbers on a branch, assuming that X is an ancestor of Y. I
leave it as an exercise to the reader to uncomment the export commands
and test them.

$ svn log -q -v -r X:Y URL | perl a.pl
    note: X<Y
    note: use 'svn log -q -v'

#########################
use strict;

use File::Basename;

my %h;
while (<>) {

    chomp;

    if ( /^ (.) (.*)/ ) {
        my $filename = $2;
        my $action = $1;

        $filename =~ s/ \(from .*:\d+\)$//;

        $h{$filename} = "$action";

        if ( $action !~ /^A|M|D$/ ) {
            warn "Warning! unknown action: '$action' for $filename\n";
            print STDERR ;
       }
    }
}

print "Delta:\n";
foreach my $filename (sort keys %h) {
    if ( $h{$filename} =~ /^A|M/ ) {
        print "\t$filename\n";
        #my $dir = dirname($filename);
        #$dir =~ s/^$root_dir//;
        #print qq(mkdir -p "$dir\n);
        #print qq(svn export "$file" "$dir"\n);
    }
}

print "\nDeletions:\n";
foreach my $filename (sort keys %h) {
    if ( $h{$filename} eq 'D' ) {
        print "\t$filename\n";
        #print qq(rm -rf "$filename"\n); ## could be a dir.
    }
}

*****

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers. AL621

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Aug 9 16:26:37 2006

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.