> Bruce asked:
>
> >
> > I am working on doing the HISTORY file for the 6.4.1 release.
> >
> > I can't figure out how to generate a cvs log for only the REL6_4 cvs
> > tree.
> >
> > Can anyone tell me how to do it?
>
> #!/bin/sh
>
> egrep -e '/[0-9]+\.[0-9]+\.2\.[0-9]+/' `find . -name Entries -print` | \
> grep '[^:]*CVS/Entries:' | \
> sed -e 's/\(Entries:\/[^\/]*\).*/\1/' | \
> sed -e 's/CVS\/Entries:\///' | \
> while read f ; do
> cvs log -rREL6_4: $f
> done
>
> Use this script in the working directory where you checked
> out the REL6_4 branch. I depends on the fact that every file,
> touched in that branch, has a 2 in it's third element of the
> revision number.
>
> The egrep-sed party just selects all file names from the
> CVS/Entries which have such a revision number. Then cvs is
> called for each to print out the log from REL6_4 to the last
> revision in the branch.
>
> Make sure there is no blank between -r and REL6_4: on the cvs
> log call, or the called rlog will misinterpret it as a
> filename and print out the complete logging for the trunk.
I have attached my pgcvslog, modified to allow revisions to be specified:
pgcvslog -r '\.2\.[0-9]*$'
It is a shame that we have to rely on one of the revisions numbers to
pull out the REL6_4 branch of the tree.
--
Bruce Momjian | http://www.op.net/~candle
maillist@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
:
# Usage $0 [-r 'revision pattern']
# pgcvslog -r REL6_4
if [ "X$1" = "X-r" ]
then REV="$2"
shift 2
else REV=".*"
fi
cat "$@" |
# mark each line with a datetime and line number, for sorting and merging
# we don't print anything from the -- or == line and the date:
awk '
$0 ~ /^Working file:/ {workingfile = $0}
$1 == "revision" && $2 !~ /'"$REV"'/ {skip = "Y"}
($0 ~ /^====*$/ || $0 ~ /^----*$/) && skip == "N" \
{
/* print blank line separating entries */
if (datetime != "")
{
printf ("%s| %10d|%s\n", datetime, NR, "");
printf ("%s| %10d|%s\n", datetime, NR, "---");
printf ("%s| %10d|%s\n", datetime, NR+1, "");
}
}
$0 ~ /^====*$/ || $0 ~ /^----*$/ \
{
datetime="";
skip="N";
}
datetime != "" && skip == "N" \
{printf ("%s| %10d| %s\n", datetime, NR, $0);}
$1 == "date:" \
{
/* get entry date */
datetime=$2"-"$3
if (workingfile != "" && skip == "N")
{
printf ("%s| %10d|%s\n", datetime, NR-1, workingfile);
printf ("%s| %10d|%s\n", datetime, NR, $0);
printf ("%s| %10d|%s\n", datetime, NR+1, "");
}
}
$0 ~ /^====*$/ {workingfile=""}' |
sort | cut -d'|' -f3 | cat |
# collect duplicate narratives
awk ' BEGIN { slot = 0;}
{
if ($0 ~ /^Working file:/)
{
if (slot != oldslot)
same = 0;
else
{
same = 1;
for (i=1; i <= slot; i++)
{
if (oldnarr[i] != narr[i])
same = 0;
}
}
if (oldslot && !same)
for (i=1; i <= oldslot; i++)
print oldnarr[i];
for (i=1; i <= slot; i++)
oldnarr[i] = narr[i];
oldslot = slot;
slot = 0;
print save_working;
save_working = $0;
}
else if ($1 != "date:")
narr[++slot] = $0;
}
END {
print save_working;
for (i=1; i <= slot; i++)
print narr[i];
}'