Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
b0bf66df
Commit
b0bf66df
authored
23 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Add HTML output option to pgcvslog.
parent
865d26fd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/tools/pgcvslog
+70
-14
70 additions, 14 deletions
src/tools/pgcvslog
with
70 additions
and
14 deletions
src/tools/pgcvslog
+
70
−
14
View file @
b0bf66df
...
@@ -19,12 +19,27 @@
...
@@ -19,12 +19,27 @@
# find . -name CVS -type d -exec rm '{}/Entries.Static' \;
# find . -name CVS -type d -exec rm '{}/Entries.Static' \;
#
#
if [ "X$1" == "X-h" ]
then HTML="Y"
shift
else HTML="N"
fi
cat "$@" |
cat "$@" |
# protect HTML input if in HTML mode
if [ "$HTML" = "Y" ]
then sed -e 's/\&/\&/g' \
-e 's/</\</g' \
-e 's/>/\>/g' \
-e 's/"/\"/g'
else cat
fi |
# mark each line with a datetime and line number, for sorting and merging
# 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:
# We don't print anything from the -- or == line and the date:
awk '
awk '
BEGIN {html="'"$HTML"'"; lineno = 0;}
# store working directory
# store working directory
$0 ~ /^Working file:/ {workingfile = "/" $3}
$0 ~ /^Working file:/ {workingfile = "/" $3}
...
@@ -33,27 +48,39 @@ awk '
...
@@ -33,27 +48,39 @@ awk '
# print blank line to separate entries
# print blank line to separate entries
if (datetime != "")
if (datetime != "")
{
{
printf ("%s| %10d|%s\n", datetime, NR, "");
if (html != "Y")
printf ("%s| %10d|%s\n", datetime, NR, "---");
printf ("%s| %10d|%s\n", datetime, lineno++, "");
printf ("%s| %10d|", datetime, lineno++);
if (html != "Y")
printf ("%s\n", "---");
else printf ("<HR>\n");
}
}
datetime="";
datetime="";
}
}
# if we have a saved datetime, print filename, date line, and committer
# if we have a saved datetime, print filename, date line, and committer
datetime != "" {printf ("%s| %10d| %s\n", datetime,
NR
, $0);}
datetime != "" {printf ("%s| %10d| %s\n", datetime,
lineno++
, $0);}
$1 == "date:"
\
$1 == "date:"
\
{
{
# get entry date
# get entry date
datetime=$2"-"$3
datetime=$2"-"$3
if (workingfile != "")
if (workingfile != "")
{
{
printf ("%s| %10d|", datetime, lineno++);
if (html != "Y")
printf ("%s\n", workingfile);
else printf ("<SMALL><FONT COLOR=\"red\">%s</FONT></SMALL>\n", workingfile);
# output name of committer
# remove semicolon from committers name
# remove semicolon from committers name
gsub("/", "-", $2);
gsub(";", "", $3);
gsub(";", "", $5);
gsub(";", "", $5);
printf ("%s| %10d|
%s\n
", datetime,
NR-2, workingfile
);
printf ("%s| %10d|", datetime,
lineno++
);
printf ("%s| %10d|%s\n", datetime, NR-1, $0);
if (html != "Y")
# output name of committer
printf ("%78s\n", $5);
printf ("
%s| %10d| %70s\n", datetime, NR+1
, $
5
);
else
printf ("
<DIV ALIGN=\"right\"><SMALL><FONT COLOR=\"teal\">%s</FONT> <FONT COLOR=\"green\">%s</FONT></SMALL></DIV>\n", $5
, $
2
);
}
}
}
}
...
@@ -64,12 +91,11 @@ sort | cut -d'|' -f3 | cat |
...
@@ -64,12 +91,11 @@ sort | cut -d'|' -f3 | cat |
# collect duplicate narratives
# collect duplicate narratives
awk ' BEGIN { slot = 0; oldslot=0; save_working = ""; }
awk ' BEGIN { slot = 0; oldslot=0; save_working = "";
html="'"$HTML"'"
}
{
{
# We have a filename, so we look at the previous
# We have a filename, so we look at the previous
# narrative to see if it is new narrative text.
# narrative to see if it is new narrative text.
#
if ($0 ~ /^\// || $0 ~ />\//)
if ($0 ~ /^\//)
{
{
# If there are a different number of narrative
# If there are a different number of narrative
# lines, they can not possibly be the same.
# lines, they can not possibly be the same.
...
@@ -93,7 +119,13 @@ awk ' BEGIN { slot = 0; oldslot=0; save_working = ""; }
...
@@ -93,7 +119,13 @@ awk ' BEGIN { slot = 0; oldslot=0; save_working = ""; }
{
{
if (oldslot)
if (oldslot)
for (i=1; i <= oldslot; i++)
for (i=1; i <= oldslot; i++)
{
print oldnarr[i];
print oldnarr[i];
if (html == "Y" &&
oldnarr[i] != "<HR>" &&
oldnarr[i] !~ "^<DIV ")
print "<BR>";
}
# save the current narrative
# save the current narrative
for (i=1; i <= slot; i++)
for (i=1; i <= slot; i++)
...
@@ -104,12 +136,14 @@ awk ' BEGIN { slot = 0; oldslot=0; save_working = ""; }
...
@@ -104,12 +136,14 @@ awk ' BEGIN { slot = 0; oldslot=0; save_working = ""; }
# dump out the previous filename
# dump out the previous filename
print save_working;
print save_working;
if (html == "Y")
print "<BR>";
# store the current filename for later printing
# store the current filename for later printing
save_working = $0;
save_working = $0;
}
}
else
# we have a narrative line
# we have a narrative line
else if ($1 != "date:")
{
{
# accumulate narrative
# accumulate narrative
narr[++slot] = $0;
narr[++slot] = $0;
...
@@ -117,9 +151,31 @@ awk ' BEGIN { slot = 0; oldslot=0; save_working = ""; }
...
@@ -117,9 +151,31 @@ awk ' BEGIN { slot = 0; oldslot=0; save_working = ""; }
}
}
END {
END {
# dump out the last filename
# dump out the last filename
print save_working;
print save_working;
if (html == "Y")
print "<BR>";
# dump out the last narrative
# dump out the last narrative
for (i=1; i <= slot; i++)
for (i=1; i <= slot; i++)
{
print narr[i];
print narr[i];
}'
if (html == "Y" &&
oldnarr[i] != "<HR>" &&
oldnarr[i] !~ "^<DIV ")
print "<BR>";
}
}' |
# add HTML wrapper
if [ "$HTML" = "Y" ]
then echo "<HTML>"
echo "<HEAD>"
echo "<TITLE>CVS</TITLE>"
echo "</HEAD>"
echo "<BODY>"
cat
echo "</BODY>"
echo "</HTML>"
else cat
fi
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment