source: trunk/openjdk/make/scripts/jdkreport.pl

Last change on this file was 390, checked in by dmik, 13 years ago

trunk: Merged in openjdk6 b25 from branches/vendor/oracle.

This accompanies an incomplete r389.

  • Property svn:eol-style set to native
File size: 4.0 KB
Line 
1#!/usr/bin/perl -w
2
3#
4# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
5# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6#
7# This code is free software; you can redistribute it and/or modify it
8# under the terms of the GNU General Public License version 2 only, as
9# published by the Free Software Foundation.
10#
11# This code is distributed in the hope that it will be useful, but WITHOUT
12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14# version 2 for more details (a copy is included in the LICENSE file that
15# accompanied this code).
16#
17# You should have received a copy of the GNU General Public License version
18# 2 along with this work; if not, write to the Free Software Foundation,
19# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20#
21# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22# or visit www.oracle.com if you need additional information or have any
23# questions.
24#
25
26$| = 1; #set buffer flushing on, so that messages are printed immediately
27
28if ($#ARGV != 1) {
29 # print "Sampel: jdkreport.pl /p/dolphin/jdk7/TAGS/jdk7 jdk7-b42:jdk7-b43 | tee reportx.html \n";
30 # print "This should contain ONLY open repos\n";
31 print "Usage: $0 repo date\n"; print "Usage: $0 repo <prev-tag:curr-tag>\n";
32 print "Usage: $0 repo jdk7-b40:jdk7-b41>\n";
33 print "Usage: $0 repo jdk7-b50:tip>\n";
34 # print "Usage: $0 media \"2008-10-29 13:00 to 2008-10-29 18:00\" \n";
35 # print "or : $0 media 2008-10-29\n"; exit;
36}
37
38$path = $ARGV[0];
39chdir ("$ARGV[0]");
40@list = `hg ftrees`;
41chomp(@list);
42
43sub print_bugs() {
44 if($first) { #print repo line if it encounters first results in prev line
45 @reponame = split '/',$i;
46 if ($reponame[$#reponame] eq "jdk6") {
47 $reponame[$#reponame] = "";
48 }
49 print "<br><br><b>http://hg.openjdk.java.net/jdk6/$reponame[$#reponame]</b>\n";
50 print '<table border="1" width="100%">';
51 print "<tr>";
52 print "<td with=\"13%\"><b> Changeset </b></td> <td width = \"7%\"><b>Bug ID</b></td> <td><b>Synopsys</b></td>";
53 print "</tr>";
54 $first = 0;
55 }
56
57 print "<tr>";
58 $rowspan = $#bugs + 1; #row span for changeset is number of bugs seen in desc
59
60 if ($reponame[$#reponame] eq "jdk7") {
61 $reponame[$#reponame] = "";
62 $sla = "";
63 } else {
64 $sla = "/";
65 }
66 $chgseturl = "http://hg.openjdk.java.net/jdk6/jdk6/" . $reponame[$#reponame]. $sla . "rev/$changeset";
67 print "<td width=\"10%\" rowspan=$rowspan><a href =\"". $chgseturl. "\"> $changeset</a> </td>";
68
69 $firstbug = 1;
70 foreach(@bugs) {
71 ($bugid, $desc) = split ':',$_, 2; # limit the number of splits to 2
72 $bugid =~ s/^\s+//; #remove leading white spaces
73 $url = "http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=$bugid";
74
75 if($firstbug) {
76 $firstbug = 0;
77 }
78 else {
79 print "<tr>"; #start new table row for 2nd bug on (1st row started above for changeset)
80 }
81 print "<td width =\"7%\"><a href =\"". $url. "\">$bugid</a></td> <td>$desc</td>\n";
82 print "</tr>";
83 }
84
85 @bugs = (); #clear list of bugs after printing them
86}
87
88foreach $i (@list) {
89 chdir("$i");
90# system("hg log -r $ARGV[1] --no-merges > /tmp/jdk7report.$$") and die "Could not run hg log for $i \n";
91system("hg log -r $ARGV[1] --no-merges --template 'changeset: {node|short}\n{desc}\n' > /tmp/jdk7report.$$") and die "C
92ould not run hg log for $i \n";
93
94 open(FILE, "/tmp/jdk7report.$$") or die "Could not openfile\n";
95
96 $first = 1;
97 @bugs = ();
98
99 while (<FILE>) {
100 if(/^changeset: /) { #check for new changeset
101 $fileline = $_;
102
103 if($#bugs >= 0) {
104 print_bugs(); #print bugs for prev changeset
105 }
106
107 ($beg, $changeset) = split ' ',$fileline; # limit the number of splits to 2
108 chomp($changeset); #remove end of line
109 }
110
111 if(/^\d+:/) { #match lines that start with numbers (bugids)
112 push(@bugs, $_);
113 }
114 }
115
116 if($first == 0) {
117 if($#bugs >= 0) { #print the bugs for the last changeset in the file
118 print_bugs();
119 }
120 print "</table>"; #close table only if first is false
121 }
122}
123
124print "<br>\n";
125
Note: See TracBrowser for help on using the repository browser.