25 # This script takes a file list and a workspace and builds a set of html files |
25 # This script takes a file list and a workspace and builds a set of html files |
26 # suitable for doing a code review of source changes via a web page. |
26 # suitable for doing a code review of source changes via a web page. |
27 # Documentation is available via 'webrev -h'. |
27 # Documentation is available via 'webrev -h'. |
28 # |
28 # |
29 |
29 |
30 WEBREV_UPDATED=24.0-hg+jbs |
30 WEBREV_UPDATED=24.1-hg+openjdk.java.net |
31 |
31 |
32 HTML='<?xml version="1.0"?> |
32 HTML='<?xml version="1.0"?> |
33 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
33 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
34 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
34 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
35 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n' |
35 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n' |
228 # e.g. |
228 # e.g. |
229 # |
229 # |
230 # $ sdiff_to_html old/usr/src/tools/scripts/webrev.sh \ |
230 # $ sdiff_to_html old/usr/src/tools/scripts/webrev.sh \ |
231 # new/usr/src/tools/scripts/webrev.sh \ |
231 # new/usr/src/tools/scripts/webrev.sh \ |
232 # webrev.sh usr/src/tools/scripts \ |
232 # webrev.sh usr/src/tools/scripts \ |
233 # '<a href="https://jbs.oracle.com/bugs/browse/JDK-1234567"> |
233 # '<a href="https://bugs.openjdk.java.net/browse/JDK-1234567"> |
234 # JDK-1234567</a> my bugid' > <file>.html |
234 # JDK-1234567</a> my bugid' > <file>.html |
235 # |
235 # |
236 # framed_sdiff() is then called which creates $2.frames.html |
236 # framed_sdiff() is then called which creates $2.frames.html |
237 # in the webrev tree. |
237 # in the webrev tree. |
238 # |
238 # |
1474 # File4 |
1474 # File4 |
1475 # A subdir/File5 |
1475 # A subdir/File5 |
1476 # The first and last are simple addition while the middle one |
1476 # The first and last are simple addition while the middle one |
1477 # is a move/rename or a copy. We can't distinguish from a rename vs a copy |
1477 # is a move/rename or a copy. We can't distinguish from a rename vs a copy |
1478 # without also getting the status of removed files. The middle case above |
1478 # without also getting the status of removed files. The middle case above |
1479 # is a rename if File4 is also shown a being removed. If File4 is not a |
1479 # is a rename if File4 is also shown a being removed. If File4 is not a |
1480 # removed file, then the middle case is a copy from File4 to subdir/File4 |
1480 # removed file, then the middle case is a copy from File4 to subdir/File4 |
1481 # FIXME - we're not distinguishing copy from rename |
1481 # FIXME - we're not distinguishing copy from rename |
1482 $HGCMD -aC | $FILTER | while read LINE; do |
1482 $HGCMD -aC | $FILTER | while read LINE; do |
1483 ldone="" |
1483 ldone="" |
1484 while [ -z "$ldone" ]; do |
1484 while [ -z "$ldone" ]; do |
1642 # File4 |
1642 # File4 |
1643 # A subdir/File5 |
1643 # A subdir/File5 |
1644 # The first and last are simple addition while the middle one |
1644 # The first and last are simple addition while the middle one |
1645 # is a move/rename or a copy. We can't distinguish from a rename vs a copy |
1645 # is a move/rename or a copy. We can't distinguish from a rename vs a copy |
1646 # without also getting the status of removed files. The middle case above |
1646 # without also getting the status of removed files. The middle case above |
1647 # is a rename if File4 is also shown a being removed. If File4 is not a |
1647 # is a rename if File4 is also shown a being removed. If File4 is not a |
1648 # removed file, then the middle case is a copy from File4 to subdir/File4 |
1648 # removed file, then the middle case is a copy from File4 to subdir/File4 |
1649 # FIXME - we're not distinguishing copy from rename |
1649 # FIXME - we're not distinguishing copy from rename |
1650 |
1650 |
1651 hg status $STATUS_REV -aC | $FILTER >$FLIST.temp |
1651 hg status $STATUS_REV -aC | $FILTER >$FLIST.temp |
1652 while read LINE; do |
1652 while read LINE; do |
2527 |
2527 |
2528 # |
2528 # |
2529 # Bug IDs will be replaced by a URL. Order of precedence |
2529 # Bug IDs will be replaced by a URL. Order of precedence |
2530 # is: default location, $WEBREV_BUGURL, the -O flag. |
2530 # is: default location, $WEBREV_BUGURL, the -O flag. |
2531 # |
2531 # |
2532 BUGURL='https://jbs.oracle.com/bugs/browse/' |
2532 BUGURL='https://bugs.openjdk.java.net/browse/' |
2533 [[ -n $WEBREV_BUGURL ]] && BUGURL="$WEBREV_BUGURL" |
2533 [[ -n $WEBREV_BUGURL ]] && BUGURL="$WEBREV_BUGURL" |
2534 if [[ -n "$Oflag" ]]; then |
2534 if [[ -n "$Oflag" ]]; then |
2535 CRID=`echo $CRID | sed -e 's/JDK-//'` |
2535 CRID=`echo $CRID | sed -e 's/JDK-//'` |
2536 BUGURL='http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=' |
2536 BUGURL='http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=' |
2537 IDPREFIX='' |
2537 IDPREFIX='' |
3054 # |
3054 # |
3055 if [[ -n $CRID ]]; then |
3055 if [[ -n $CRID ]]; then |
3056 for id in $CRID |
3056 for id in $CRID |
3057 do |
3057 do |
3058 if [[ -z "$Oflag" ]]; then |
3058 if [[ -z "$Oflag" ]]; then |
3059 #add "JDK-" to raw bug id for jbs links. |
3059 #add "JDK-" to raw bug id for openjdk.java.net links. |
3060 id=`echo ${id} | sed 's/^\([0-9]\{5,\}\)$/JDK-\1/'` |
3060 id=`echo ${id} | sed 's/^\([0-9]\{5,\}\)$/JDK-\1/'` |
3061 fi |
3061 fi |
3062 print "<tr><th>Bug id:</th><td>" |
3062 print "<tr><th>Bug id:</th><td>" |
3063 url="${BUGURL}${id}" |
3063 url="${BUGURL}${id}" |
3064 if [[ -n "$Oflag" ]]; then |
3064 if [[ -n "$Oflag" ]]; then |