1919# find . -name CVS -type d -exec rm '{}/Entries.Static' \;
2020#
2121
22+ if [ "X$1" == "X-h" ]
23+ thenHTML="Y"
24+ shift
25+ elseHTML="N"
26+ fi
27+
2228cat "$@" |
2329
30+ # protect HTML input if in HTML mode
31+ if [ "$HTML" = "Y" ]
32+ thensed -e 's/\&/\&/g' \
33+ -e 's/</\</g' \
34+ -e 's/>/\>/g' \
35+ -e 's/"/\"/g'
36+ elsecat
37+ fi |
38+
2439# mark each line with a datetime and line number, for sorting and merging
2540# We don't print anything from the -- or == line and the date:
2641
27- awk '
42+ awk 'BEGIN{html="'"$HTML"'"; lineno = 0;}
2843# store working directory
2944$0 ~ /^Working file:/{workingfile = "/" $3}
3045
@@ -33,27 +48,39 @@ awk '
3348# print blank line to separate entries
3449if (datetime != "")
3550{
36- printf ("%s| %10d|%s\n", datetime, NR, "");
37- printf ("%s| %10d|%s\n", datetime, NR, "---");
51+ if (html != "Y")
52+ printf ("%s| %10d|%s\n", datetime, lineno++, "");
53+ printf ("%s| %10d|", datetime, lineno++);
54+ if (html != "Y")
55+ printf ("%s\n", "---");
56+ elseprintf ("<HR>\n");
3857}
3958datetime="";
4059}
4160
4261# if we have a saved datetime, print filename, date line, and committer
43- datetime != "" {printf ("%s| %10d| %s\n", datetime,NR , $0);}
62+ datetime != "" {printf ("%s| %10d| %s\n", datetime,lineno++ , $0);}
4463
45- $1 == "date:" \
64+ $1 == "date:" \
4665{
4766# get entry date
4867datetime=$2"-"$3
4968if (workingfile != "")
5069{
70+ printf ("%s| %10d|", datetime, lineno++);
71+ if (html != "Y")
72+ printf ("%s\n", workingfile);
73+ elseprintf ("<SMALL><FONT COLOR=\"red\">%s</FONT></SMALL>\n", workingfile);
74+
75+ # output name of committer
5176# remove semicolon from committers name
77+ gsub("/", "-", $2);
78+ gsub(";", "", $3);
5279gsub(";", "", $5);
53- printf ("%s| %10d|%s\n ", datetime,NR-2, workingfile );
54- printf ("%s| %10d|%s\n", datetime, NR-1, $0);
55- # output name of committer
56- printf ("%s| %10d| %70s \n",datetime, NR+1, $5 );
80+ printf ("%s| %10d|", datetime,lineno++ );
81+ if (html != "Y")
82+ printf ("%78s\n", $5);
83+ else printf ("<DIV ALIGN=\"right\"><SMALL><FONT COLOR=\"teal\">%s</FONT> <FONT COLOR=\"green\">%s</FONT></SMALL></DIV> \n",$5, $2 );
5784}
5885}
5986
@@ -64,12 +91,11 @@ sort | cut -d'|' -f3 | cat |
6491
6592# collect duplicate narratives
6693
67- awk ' BEGIN { slot = 0; oldslot=0; save_working = ""; }
94+ awk ' BEGIN { slot = 0; oldslot=0; save_working = "";html="'"$HTML"'" }
6895{
6996# We have a filename, so we look at the previous
7097# narrative to see if it is new narrative text.
71- #
72- if ($0 ~ /^\//)
98+ if ($0 ~ /^\// || $0 ~ />\//)
7399{
74100# If there are a different number of narrative
75101# lines, they can not possibly be the same.
@@ -93,7 +119,13 @@ awk ' BEGIN { slot = 0; oldslot=0; save_working = ""; }
93119{
94120if (oldslot)
95121for (i=1; i <= oldslot; i++)
122+ {
96123print oldnarr[i];
124+ if (html == "Y" &&
125+ oldnarr[i] != "<HR>" &&
126+ oldnarr[i] !~ "^<DIV ")
127+ print "<BR>";
128+ }
97129
98130# save the current narrative
99131for (i=1; i <= slot; i++)
@@ -104,22 +136,46 @@ awk ' BEGIN { slot = 0; oldslot=0; save_working = ""; }
104136
105137# dump out the previous filename
106138print save_working;
139+ if (html == "Y")
140+ print "<BR>";
107141
108142# store the current filename for later printing
109143save_working = $0;
110144}
145+ else
111146# we have a narrative line
112- else if ($1 != "date:")
113147{
114148# accumulate narrative
115149narr[++slot] = $0;
116150}
117151}
118152END{
119153# dump out the last filename
154+
120155print save_working;
156+ if (html == "Y")
157+ print "<BR>";
121158
122159# dump out the last narrative
123160for (i=1; i <= slot; i++)
161+ {
124162print narr[i];
125- }'
163+ if (html == "Y" &&
164+ oldnarr[i] != "<HR>" &&
165+ oldnarr[i] !~ "^<DIV ")
166+ print "<BR>";
167+ }
168+ }' |
169+
170+ # add HTML wrapper
171+ if [ "$HTML" = "Y" ]
172+ thenecho "<HTML>"
173+ echo "<HEAD>"
174+ echo "<TITLE>CVS</TITLE>"
175+ echo "</HEAD>"
176+ echo "<BODY>"
177+ cat
178+ echo "</BODY>"
179+ echo "</HTML>"
180+ elsecat
181+ fi