[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Difference between two versions

From: Josh Baudhuin
Subject: RE: Difference between two versions
Date: Fri, 27 Jul 2001 01:15:19 -0700

Not sure if this is QUITE what you want, but I offer it nonetheless. I have a 
script which summarizes the output from the  cvs status  command. (It might not 
give you the information you want about new or deleted directories--I'm not 
sure that cvs status does that, either.) It gives output somewhat like the  cvs 
update  command. E.g., precedes the filename with "M " when a file is modified, 
"C " when there are conflicts, etc. It works on PCs and on unix...

use FileHandle;
autoflush STDOUT 1;
open STAT, "cvs status " . join(' ', @ARGV) . " 2>&1 |";
while ($_ = <STAT>) {
    print, next  if /^cvs server:/ || /\? [\/\+\-\w\.]*/;
    next  unless /File:\s+(no file\s+)?([\/\+\-\w\.]*)\s+Status:\s+(.*)/;
    next  if $3 eq 'Up-to-date';
    ($nofile, $file, $stat) = ($1, $2, $3);
    $mod = 'X';
    if ($stat =~ /(Needs|Locally) (\w)/) {
        $mod = $2;
    } elsif ($stat =~ /^File had conflicts/) {
        $mod = 'C';
    } else {
        print "$_\n";
    print "$mod $file\n";
close STAT;

> -----Original Message-----
> From: address@hidden [mailto:address@hidden Behalf Of
> Manish Koolwal
> Sent: Friday, July 27, 2001 12:17 AM
> To: address@hidden
> Subject: Difference between two versions
> Hi!
>   There are 5 type of changes in our module. They are:
> 1) Modification of existing files
> 2) Addition of new files
> 3) Deletion of existing files
> 4) Addition of new directories
> 5) Removal of existing directories
>   I suppose that cvs diff command will give me the list of all
> the files modified and the difference among the files. What I
> want is to obtain all the above 5 information automatically ie.,
> a list of all the files modified, added, deleted, directories
> added and deleted. I am a bit aware of CVS have nearly
> negligible knowledge of shell scripting. How can I get the
> desired result? Kindly advice.
>   Regards,
>   Manish Koolwal

reply via email to

[Prev in Thread] Current Thread [Next in Thread]