]> git.ipfire.org Git - thirdparty/git.git/commitdiff
cook.sh: move the "New Topics" generation to the template handler code
authorJunio C Hamano <gitster@pobox.com>
Mon, 24 Aug 2009 00:05:16 +0000 (17:05 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Aug 2009 00:05:16 +0000 (17:05 -0700)
cook.sh

diff --git a/cook.sh b/cook.sh
index 471a8da98e3492e4076352a9f63ed080ee8a8932..4d5864281e9dacd4d6a01ffa0c111f88b39b52e1 100755 (executable)
--- a/cook.sh
+++ b/cook.sh
@@ -287,6 +287,29 @@ perl -w -e '
                }
        }
 
+       if (open I, "<$tmp.output.toc") {
+               $section = "New Topics";
+               while (<I>) {
+                       my ($branch, $oldserial) = /^(\S*) (\d+)$/;
+                       next if (exists $branch{$branch});
+                       if (!exists $section{$section}) {
+                               push @section, $section;
+                               $section{$section} = [];
+                       }
+                       push @branch, [$branch, $section];
+                       $branch{$branch} = (scalar @branch) - 1;
+                       if (!exists $description{$branch}) {
+                               $description{$branch} = [];
+                       }
+                       open II, "<$tmp.output.$oldserial";
+                       while (<II>) {
+                               push @{$description{$branch}}, $_;
+                       }
+                       close II;
+               }
+               close I;
+       }
+
        open O, ">$tmp.template.blurb";
        for (@{$description{$blurb}}) {
                print O $_;
@@ -326,15 +349,6 @@ else
        cat "$tmp.output.blurb"
 fi | sed -e '$d'
 
-while read branch serial
-do
-       grep "^$branch " "$tmp.template.toc" >/dev/null && continue 
-
-       tmpserial=$(( $tmpserial + 1 ))
-       echo "$branch $tmpserial New Topics" >>"$tmp.template.toc"
-       cp "$tmp.output.$serial" "$tmp.template.$tmpserial"
-done <"$tmp.output.toc"
-
 current='--------------------------------------------------
 [Graduated to "master"]
 '