This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gui] Implement RescaleOp


>>>>> "Andrew" == Andrew Haley <aph@redhat.com> writes:

Andrew> Of course, this problem is caused by the fact that CVS doesn't have
Andrew> atomic multi-file commits.  However, it ought to be possible to write
Andrew> a tool that extracts patches from CVS logs, which is presumably what
Andrew> is really needed.

Yeah, this has been done several times.  It is also really trivial to
do this given the cvs commit email.  Appended is a patch reverter that
works on this principle.  The one drawback is that it is a bit slow.

Tom

#! /usr/bin/perl -n

# This takes a gcc-style cvs commit message, extracts the URLs from
# it, and generates a small shell script to revert the patch.

if (m,http://.*\.cgi/(.+)/([^/]+)\?cvsroot=[a-z]+\&r1=([^&]+)\&r2=([^&\n]+)$,)
{
    $dir = $1;
    $file = $2;
    $r1 = $3;
    $r2 = $4;

    if ($file eq 'ChangeLog') {
	# Don't revert ChangeLog entries.
    } elsif ($r1 eq 'NONE') {
	print "cvs rm -f $dir/$file\n";
    } else {
	print "(cd $dir; cvs update -j$r2 -j$r1 $file)\n";
    }
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]