Skip to content
Snippets Groups Projects
Commit 56b7da2f authored by Andreas Dilger's avatar Andreas Dilger
Browse files

Add cvsdiffclient and cvs-modified-files.pl to CVS (needs a usage note).

parent 42a807b6
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env perl
my $mode = "NONE";
my @modified, @added, @removed;
while($line = <>) {
if ($line =~ /Modified Files:/) {
$mode = "MODIFIED";
next;
}
if ($line =~ /Added Files:/) {
$mode = "ADDED";
next;
}
if ($line =~ /Removed Files:/) {
$mode = "REMOVED";
next;
}
if ($mode eq "NONE") { next; }
if ($line =~ /-------/) { next; }
chop($line);
$line =~ s/^CVS:\s+//;
$line =~ s/\s+$//;
# print "processing $line for $mode\n";
@files = split(/ /, $line);
# print "new files for $mode: ", join(', ', @files), "\n";
if ($mode eq "MODIFIED") {
push(@modified, @files);
} elsif ($mode eq "ADDED") {
push(@added, @files);
} elsif ($mode eq "REMOVED") {
push(@removed, @files);
} else {
die "Unknown mode $mode!";
}
}
print join(' ', @modified);
if ($ENV{"SHOW_ALL_FILES"} ne "no") {
print ' ', join(' ', @added), ' ', join(' ', @removed);
}
print "\n";
#!/bin/bash
[ -f .mergeinfo ] && . ./.mergeinfo
FILES=`cvs-modified-files.pl $1`
TMP=`mktemp /tmp/cvslog-XXXXXXXX`
if [ -f $TMP ]; then
[ -f .mergeinfo ] && \
echo "CVS: Update $child from $parent ($date)" >> $TMP
echo "CVS: did you update the ChangeLog for a bug fix?" >> $TMP
echo "CVS: b=" >> $TMP
echo "CVS: r=" >> $TMP
cat $1 >> $TMP
cp $TMP $1
rm $TMP
fi
if [ "${FILES:+have_files}"x = have_filesx ]; then
echo Diffing $1 : $FILES
cvs diff -wbBup $FILES 2>/dev/null | sed "s/^/CVS: /" >>$1
fi
#gnuclient $1 || vi $1
[ "$EDITOR" ] || EDITOR=vi
$EDITOR $1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment