• Home
  • History
  • Annotate
  • Raw
  • Download

Lines Matching +full:rev +full:- +full:parse

1 #!/usr/bin/perl -w
2 #--*-Perl-*--
16 # debug - if set, output debugging info
17 # user - user name
18 # path_info - override actual path info, for debugging, e.g., "/form"
19 # mod - module(s) list
20 # include_attic - if set, include Attic during search (ignored by default)
24 #use CGI::Carp qw(fatalsToBrowser); # Do NOT use this -- doesn't work
49 #---------------------------------------------------------------------
53 $DEBUG = $QUERY->param('debug');
56 # User name, if any. We try to propagate the user name so a logged-in
58 $USER = $QUERY->param('user');
75 $DIFF_URL = "http://www.unicode.org/cgi-bin/viewcvs.cgi"; # No trailing "/"
79 # E.g., suffix with "/icu/icu/license.html?rev=1.1$SHOW_URL_SUFFIX"
81 $SHOW_URL_SUFFIX = "&content-type=text/x-cvsweb-markup" . $CVSWEB_REP_SUFF;
129 # Root of our cache of CVS meta-information. Right now this cache
141 #$CACHE = "/www/software10/cgi-bin/icu/grepj.cache";
143 $CACHE = "/tmp/icu-grepj.cache"; # No trailing "/"
145 $CACHE = "/tmp/icu-grepj-cldr.cache"; # No trailing "/"
187 #---------------------------------------------------------------------
192 STDOUT->autoflush(1); # Make progress output appear progressively...
203 # "http://oss.software.ibm.com/cvs/icu-jinfo/foo", the path
206 my $path_info = $QUERY->path_info;
207 if ($QUERY->param('path_info')) {
208 $path_info = $QUERY->param('path_info');
219 print $QUERY->header;
223 $fn->();
228 print $QUERY->header;
236 print $QUERY->end_html;
240 #---------------------------------------------------------------------
246 return "http://bugs.icu-project.org/cgibin/private/byname/review$user";
249 #---------------------------------------------------------------------
260 return "http://bugs.icu-project.org/cgibin/private/icu-bugs-private?;user=$user;findid=$id";
262 return "http://bugs.icu-project.org/cgibin/icu-bugs?findid=$id";
266 return "http://bugs.icu-project.org/cgibin/private/icu-bugs-private?;user=$user;";
268 return "http://bugs.icu-project.org/cgibin/icu-bugs";
274 return "http://bugs.icu-project.org/cgibin/cldr/locale-bugs-private?;user=$user;findid=$id";
276 return "http://bugs.icu-project.org/cgibin/locale-bugs?findid=$id";
280 return "http://bugs.icu-project.org/cgibin/cldr/locale-bugs-private?;user=$user;";
282 return "http://bugs.icu-project.org/cgibin/locale-bugs";
296 my $self = $QUERY->url(-full=>1, -query=>1);
304 <!--$self-->
321 print $QUERY->start_html(-title=>$TITLE,
322 -target=>'difflist');
324 my $script_name = $QUERY->script_name;
326 print $QUERY->startform(-action=>urlPathInfo($script_name, '/difflist'),
327 -target=>'difflist',
328 -method=>'GET');
330 my $user = $QUERY->param('user') || '';
333 print " <FONT SIZE=-1>($user)</FONT>" if ($user);
336 print "ID? ",$QUERY->textfield(-name=>'id',-size=>5)
337 , $QUERY->submit(-name=>'Search')
338 , " <FONT SIZE=-1><A href=\""
342 print "\&nbsp;<FONT SIZE=-1>"
347 print $QUERY->textfield(-name=>'mod',
348 -default=>$DEFAULT_MOD,
349 -size=>30);
353 print "<FONT SIZE=-1>";
354 print $QUERY->checkbox(-name=>"include_attic",
355 -label=>"Incl. Attic");
356 print $QUERY->checkbox(-name=>"localdiff",
357 -label=>"Local Diff");
365 print $QUERY->hidden('user');
366 print $QUERY->hidden('debug');
368 print $QUERY->hidden('cldr');
371 print $QUERY->end_form;
375 print $QUERY->start_html(-title=>$TITLE,
376 -target=>'result');
381 print $QUERY->start_html(-title=>$TITLE,
382 -target=>'result');
387 my $ID = $QUERY->param('id') || '';
391 #print $QUERY->Dump;
411 my $user = $QUERY->param('user');
419 my $localDiff = $QUERY->param('localdiff');
445 print "<BR><EM><FONT SIZE=-1>(Results from cache)</FONT></EM>";
462 debugOut("-generateDiffsList($ID, $module)") if ($DEBUG);
468 print $QUERY->header(-type=>'application/octet-stream',
469 -attachment=>'localdiff.bat');
470 my $file = $QUERY->param('file');
471 my $r1 = $QUERY->param('r1');
472 my $r2 = $QUERY->param('r2');
473 my $mod = $QUERY->param('m');
482 print "cvs checkout -p -r $r1 $file > $leaf-$r1$eol";
483 print "cvs checkout -p -r $r2 $file > $leaf-$r2$eol";
484 print "start wincmp $leaf-$r1 $leaf-$r2$eol";
489 print $QUERY->start_html(-title=>$TITLE);
555 my $self = $QUERY->url(-full=>1, -query=>1);
561 #`h TITLETXT = "$id - $TITLETXT";
576 print $QUERY->start_html(-title=>$TITLE,
577 -target=>'adminresult');
579 my $script_name = $QUERY->script_name;
581 print $QUERY->startform(-action=>urlPathInfo($script_name, '/adminresult'),
582 -TARGET=>'adminresult');
586 my $user = $QUERY->param('user');
588 print "\&nbsp;<FONT SIZE=-1>"
591 print '<FONT SIZE=-1>Tags may be specified in full, e.g. '
592 , '"release-2-4", or as release numbers, such as "2.4". ',
597 print $QUERY->textfield(-name=>'mod',
598 -default=>$DEFAULT_MOD,
599 -size=>30);
604 print $QUERY->textfield(-name=>'tag_lo',-size=>30);
606 print $QUERY->textfield(-name=>'tag_hi',-size=>30);
608 print $QUERY->submit(-name=>'Find Bugs');
610 …print '<FONT SIZE=-1>Bugs are listed that occur after the start tag, up to and including the end t…
616 print $QUERY->textfield(-name=>'dcut_tag',-size=>33);
618 print $QUERY->textarea(-name=>'dcut_ids',-rows=>8,-columns=>26);
620 print $QUERY->submit(-name=>'Check');
622 print '<FONT SIZE=-1>Enter a CVS tag and list of bugs to incorporate '
628 print $QUERY->submit(-name=>'Reset Insta Cache'), "<BR>";
629 print '<FONT SIZE=-1>The insta cache contains the HTML output for previous'
635 print $QUERY->submit(-name=>'Delete Cache File:'), "&nbsp;";
636 print $QUERY->textfield(-name=>'del_cache',-size=>17), "<BR>";
637 print '<FONT SIZE=-1 >Delete a file from the cache. Path is relative'
642 print $QUERY->hidden('user');
643 print $QUERY->hidden('debug');
645 print $QUERY->end_form;
650 print $QUERY->start_html(-title=>$TITLE);
652 if ($QUERY->param('Find Bugs')) {
657 if ($QUERY->param('Check')) {
662 if ($QUERY->param('Reset Insta Cache')) {
668 if ($QUERY->param('Delete Cache File:')) {
669 my $f = $QUERY->param('del_cache');
670 # Careful here -- don't let the user delete anything but a
672 if ($f !~ m|^[a-z0-9_]+(/[a-z0-9_]+)+\.[a-z0-9]+$|i) {
677 if (! -e $f) {
681 if (! -f $f) {
687 #if (! -e $f) {
701 #---------------------------------------------------------------------
721 # During merging, the bug IDs 1-98 for icu4j were migrated to
722 # 1301-1398. Therefore, when the user requests a bug in the range
723 # 1301-1398, we search under both n and n-1300 in icu4j
726 my $ID2 = $ID - 1300;
730 # -E use extended regexp
731 # -i ignore case
732 # -I ignore binary files
733 # -l stop at first match and list file name
734 # -r recurse
736 #my $flags = $ignoreBinaries ? "-EiIlr" : "-Eilr";
740 my @files = `grep -Eilr "($CVS_MSG_KW)[ \\t]*$pat\\b" $greproot`;
742 if (!$QUERY->param('include_attic')) {
751 $result .= out("<FONT SIZE=-1>");
764 my $localDiff = $QUERY->param('localdiff');
778 for (my $i=0; $i<$#r; $i++) { # [sic] from first to last-1
779 if ($r[$i]->{old} ne $r[$i+1]->{new}) {
784 my $new = $r[0]->{new};
785 my $old = $r[$#r]->{old};
791 $result .= out("<A href=\"$show_url$relFile?rev=$new$SHOW_URL_SUFFIX\">");
797 my $self = $QUERY->url(-full=>1, -query=>1);
810 for (my $i=0; $i<$#r; $i++) { # [sic] from first to last-1
811 if ($r[$i]->{old} ne $r[$i+1]->{new}) {
819 my $new = $r[$range->[0]]->{new};
820 my $old = $r[$range->[1]]->{old};
828 $result .= out("<A href=\"$show_url$relFile?rev=$new$SHOW_URL_SUFFIX\">");
834 my $self = $QUERY->url(-full=>1, -query=>1);
850 my $new = $h->{new};
851 my $old = $h->{old};
853 $result .= out("<A href=\"$show_url$relFile?rev=$new$SHOW_URL_SUFFIX\">");
859 my $self = $QUERY->url(-full=>1, -query=>1);
866 $result .= out(" <EM>", $h->{date}, "</EM> by <EM>", $h->{author}, "</EM><BR>");
867 $result .= out($h->{comment});
892 my $c = $b[$i] - $a[$i];
895 return $#b - $#a;
908 $TAGSCAN_TAG_LO = expandTag($QUERY->param('tag_lo'));
909 $TAGSCAN_TAG_HI = expandTag($QUERY->param('tag_hi'));
918 my $user = $QUERY->param('user');
923 # Slight limitation -- our tagLink will only refer to the first module
965 map {logLink($_->[0],'grepj_2') .
966 ", " . $_->[1] . "<BR><CODE>" .
967 $_->[2] . "</CODE>"}
988 map {logLink($_->[0],'grepj_2') .
989 ": " . $_->[1] . " => " . $_->[2]}
1014 <form method=post action=http://bugs.icu-project.org/cgibin/private/tasklist/buglist.html>
1023 <form method=GET action=http://bugs.icu-project.org/cgibin/private/byname/review>
1031 <form method=GET action=http://bugs.icu-project.org/cgibin/private/byname/assign>
1049 if (-d "$CACHE/$relDir/$item") {
1079 debugOut("-tagscanDir($relDir)") if ($DEBUG);
1096 # Parse the rlog file. Start by extracting the tag names. Look
1139 if (/^date:.+state: ([A-Za-z]+)/) {
1202 #|----------------------------
1204 #|date: 2001/08/02 18:24:58; author: grhoten; state: Exp; lines: +82 -73
1215 if (/^-{20,}$/) {
1218 my $rev = $1;
1219 last if ($rev eq $rev_lo);
1221 if ($rev eq $rev_hi || $rev_hi eq 'HEAD') {
1233 push @NO_JITTERBUG_FILES, [$relFile, $rev, $_]
1234 if (noJitterbugFilter($rev, $date));
1237 push @result, [$rev, $id, $date];
1241 last; # This is very bad - bail out
1260 if (/^-{20,}$/) {
1263 my $rev = $1;
1264 if (exists $revs{$rev}) {
1265 delete $revs{$rev};
1267 if ($rev eq $rev_hi) {
1273 cantParse('date', $relFile, $date, $rev);
1281 $TAGSCAN_WHY{$id}->{$relFile} = 1;
1283 push @NO_JITTERBUG_FILES, [$relFile, $rev, $_]
1284 if (noJitterbugFilter($rev, $date));
1292 last; # This is very bad - bail out
1307 # $revision->[ revision, jitterbug ID, date: line ]
1308 $TAGSCAN_IDS{$revision->[1]} = 1;
1309 $TAGSCAN_WHY{$revision->[1]}->{$relFile} = 1;
1314 if ($a->[0]->[2] =~ /^date: (.+?);/) {
1318 cantParse('date', $relFile, $a->[0]->[2], $a->[0]->[0]);
1329 $DCUTHELP_TAG = expandTag($QUERY->param('dcut_tag'));
1330 my $ids = $QUERY->param('dcut_ids');
1331 my $user = $QUERY->param('user');
1388 map {logLink($_->[0],'grepj_2') .
1389 ", " . $_->[1] . "<BR><CODE>" .
1390 $_->[2] . "</CODE>"}
1413 map {logLink($_->[0],'grepj_2') .
1414 ": " . $_->[1] . ", " . $_->[2]}
1426 my $relFile = $_->[0];
1427 my $ids = $_->[1];
1449 print "<BR><BR><CODE><FONT SIZE=-1>";
1456 my $relFile = $_->[0];
1465 my $rev_hi = $_->[1];
1469 print "cvs tag -F -r $rev_hi $DCUTHELP_TAG $relFile";
1502 if (-d "$CACHE/$relDir/$item") {
1544 # Parse the rlog file. Start by extracting the tag names. Look
1565 if (/^date:.+state: ([A-Za-z]+)/) {
1584 #|----------------------------
1586 #|date: 2001/08/02 18:24:58; author: grhoten; state: Exp; lines: +82 -73
1593 # on the allowed list. Locate $rev_hi - the high
1599 if (/^-{20,}$/) {
1602 my $rev = $1;
1603 $bottom_rev = $rev;
1604 if ($rev eq $rev_tag) {
1605 # Scan remainder of file to record last rev
1607 if (/^-{20,}$/) {
1621 push @NO_JITTERBUG_FILES, [$relFile, $rev, $_]
1622 if (noJitterbugFilter($rev, $date));
1630 # $rev_hi = $rev;
1638 $rev_hi = $rev;
1659 # Parse all the revisions and form a branch tree.
1661 # In addition, "$rev-" maps to a ref to an array of branches,
1666 if (/^-{20,}$/) {
1669 my $rev = $1;
1674 $tree{$rev . '-'} = \@branches;
1681 push @NO_JITTERBUG_FILES, [$relFile, $rev, $_]
1682 if (noJitterbugFilter($rev, $date));
1685 $tree{$rev} = $id;
1720 if (/^-{20,}$/) {
1723 my $rev = $1;
1724 if (exists $revs{$rev}) {
1725 delete $revs{$rev};
1733 push @NO_JITTERBUG_FILES, [$relFile, $rev, $_]
1734 if (noJitterbugFilter($rev, $date));
1744 last; # This is very bad - bail out
1767 # return 'rev;rev'. If not found at all, return ''. If found on
1776 # @return either a revision, or 'rev;rev' if the bugs occur
1780 my $rev = shift; # rev to start at
1781 my $exclusive = shift || ''; # is $rev exclusive?
1783 # print "[scan $tree $rev $exclusive]";
1785 # If there are no branches between $rev and the end of its branch,
1787 my $branchrev = ''; # First rev at which branch was seen, if any
1788 my $lastbugrev = ''; # Last rev at which bug was seen
1790 for ($r=$rev ;exists $tree->{$r}; $r=incRev($r)) {
1792 if (exists $DCUTHELP_IDS{$tree->{$r}}) {
1795 if (exists $tree->{"$r-"}) {
1801 # If $exclusive it true, can't return this rev.
1802 if ($exclusive && ($lastbugrev eq $rev)) {
1813 # rev on each branch, e.g., "1.14.2" => "1.14.2.1"
1814 my @branches = map {"$_.1"} @{$tree->{"$branchrev-"}};
1816 push @branches, $r if (exists $tree->{$r});
1842 #---------------------------------------------------------------------
1852 if (-d "$CVSROOT/$relDir/$item") {
1859 #---------------------------------------------------------------------
1877 if (!$QUERY->param('include_attic')) {
1885 if (-d $cacheDir) {
1888 debugOut("-!updateCacheDir($relDir)") if ($DEBUG);
1910 debugOut("-updateCacheDir($relDir)") if ($DEBUG);
1913 #---------------------------------------------------------------------
1920 if (! -e "$CACHE/$relFile" ||
1921 (-M "$CACHE/$relFile" > -M "$CVSROOT/$relFile")) {
1924 if(! -e "$CACHE/$relFile") {
1940 my $size = -s $f;
1945 command("touch -r $CVSROOT/$relFile $f");
1953 #---------------------------------------------------------------------
1961 my $dir = $QUERY->param('include_attic') ? $INSTA_ATTIC : $INSTA;
1963 if (-e $file) {
1972 #---------------------------------------------------------------------
1978 my $dir = $QUERY->param('include_attic') ? $INSTA_ATTIC : $INSTA;
1985 #---------------------------------------------------------------------
1992 command("rm -rf $INSTA"); # Recursive
1996 # If there have been changes to non-Attic files, we
2000 # rm: cannot remove `/tmp/icu-grepj.cache/insta/Attic': Is a directory
2001 #command("rm -f $INSTA/*") if (-d $INSTA);
2002 command("find $INSTA -type f -maxdepth 1 -exec rm {} \\;")
2003 if (-d $INSTA);
2006 command("rm -f $INSTA_ATTIC/*") if (-d $INSTA_ATTIC);
2014 #---------------------------------------------------------------------
2023 # Parse the rlog file. Return the date line for 1.1
2026 if (/^-{20,}$/) {
2038 ''; # Parse failure - should never happen
2041 #---------------------------------------------------------------------
2061 #|date: 1999/10/14 22:14:04; author: schererm; state: Exp; lines: +4 -2
2063 #|----------------------------
2065 #|date: 1999/10/13 01:10:24; author: schererm; state: Exp; lines: +9 -6
2068 #|----------------------------
2079 if (/^-{20,}$/) {
2118 s/\s*----+\s*$//;
2134 #---------------------------------------------------------------------
2135 # Given a tag name like this: "2.1", expand it to "release-2-1".
2143 s|\.|-|g;
2144 $_ = "release-" . $_;
2151 #---------------------------------------------------------------------
2152 # Given a tag name like this: "release-1-5-0-d03", return a normalized
2154 # The final release (no 'd') "release-1-5-0" is 1500099; that is, it
2157 # (e.g., "release-1-4-1-2"). Assume all numbers are single digits
2158 # except for the 'd' number. The tag must start with /release-?/.
2159 # All digits must be separated by '-', except the '-' before the 'd03'
2162 # as a 'd' of 00, e.g., "release-2-0-2s-branch".
2164 # @param a tag string, like "release-1-5-0-d03"
2169 if (s/^release-?//i) {
2171 my $d = -1;
2173 if (s/^(\d)-// ||
2175 s/(\d)(\D)/$2/) { # e.g., "release-1-4-2d01"
2183 # If we have some trailing non-standard text, and no 'd',
2195 0; # parse failure
2205 print "<P><FONT SIZE=-1><B>", join(" ", @_), "</B></FONT></P>";
2225 # Append the given path-info to the given URL
2238 # Parse the module params given by the user
2246 my $mod = $QUERY->param('mod') || $DEFAULT_MOD;
2254 push @badMod, $_ if (! -d "$CVSROOT/$_");
2309 # Emit an error (in HTML) about failing to parse a line.
2318 my $rev = shift;
2319 $rev = ', '.$rev if ($rev);
2320 print "<BR>Error: Can't parse $what in "
2321 , logLink($relFile, 'grepj_2'), "$rev:<BR>\n";
2374 last if ($a[-1] == $limit[-1]);
2386 if ($a[-2] == 0) {
2388 $a[-2] = $a[-1];
2389 $a[-1] = 1;
2391 $a[-1]++;
2417 my $i = $1 - 1;
2431 # return the duration $NOW - x, in days.
2435 my ($y,$m,$d,$H,$M,$S) = ($1,$2-1,$3,$4,$5,$6);
2438 $y -= 100 if ($y > $YEAR);
2440 return ($NOW - timelocal_nocheck($S,$M,$H,$d,$m,$y)) / 86400.0;
2442 die "Can't parse date $_\n";
2451 my $rev = shift;
2453 #if ($rev eq '1.1' || $rev eq '1.1.1.1') {