8004726: Link bug ids to jbs rather than monaco.

Wed, 06 Feb 2013 11:09:24 -0800

author
mduigou
date
Wed, 06 Feb 2013 11:09:24 -0800
changeset 616
168dd033604a
parent 615
8dd61906da5f
child 617
7817368287cd

8004726: Link bug ids to jbs rather than monaco.
Reviewed-by: ohair, chegar, katleman

make/scripts/webrev.ksh file | annotate | diff | comparison | revisions
     1.1 --- a/make/scripts/webrev.ksh	Wed Feb 06 11:36:19 2013 +0000
     1.2 +++ b/make/scripts/webrev.ksh	Wed Feb 06 11:09:24 2013 -0800
     1.3 @@ -19,7 +19,7 @@
     1.4  #
     1.5  # CDDL HEADER END
     1.6  #
     1.7 -# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
     1.8 +# Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
     1.9  # Use is subject to license terms.
    1.10  #
    1.11  # This script takes a file list and a workspace and builds a set of html files
    1.12 @@ -27,7 +27,7 @@
    1.13  # Documentation is available via 'webrev -h'.
    1.14  #
    1.15  
    1.16 -WEBREV_UPDATED=23.18-hg
    1.17 +WEBREV_UPDATED=23.18-hg+jbs
    1.18  
    1.19  HTML='<?xml version="1.0"?>
    1.20  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    1.21 @@ -146,7 +146,7 @@
    1.22  #
    1.23  bug2url()
    1.24  {
    1.25 -	sed -e 's|[0-9]\{5,\}|<a href=\"'$BUGURL'&\">&</a>|g'
    1.26 +	sed -e 's|[0-9]\{5,\}|<a href=\"'$BUGURL$IDPREFIX'&\">&</a>|g'
    1.27  }
    1.28  
    1.29  #
    1.30 @@ -230,8 +230,8 @@
    1.31  #   $ sdiff_to_html old/usr/src/tools/scripts/webrev.sh \
    1.32  #         new/usr/src/tools/scripts/webrev.sh \
    1.33  #         webrev.sh usr/src/tools/scripts \
    1.34 -#         '<a href="http://monaco.sfbay.sun.com/detail.jsp?cr=1234567">
    1.35 -#          1234567</a> my bugid' > <file>.html
    1.36 +#         '<a href="https://jbs.oracle.com/bugs/browse/JDK-1234567">
    1.37 +#          JDK-1234567</a> my bugid' > <file>.html
    1.38  #
    1.39  # framed_sdiff() is then called which creates $2.frames.html
    1.40  # in the webrev tree.
    1.41 @@ -1160,7 +1160,7 @@
    1.42  	            print "$comm"
    1.43  	            return
    1.44  	        fi
    1.45 -	  
    1.46 +
    1.47  	        print "$comm" | html_quote | bug2url | sac2url
    1.48                  )
    1.49          fi
    1.50 @@ -1418,7 +1418,7 @@
    1.51                    next;}
    1.52          END       {for (tree in trees)
    1.53                          { rev=revs[trees[tree]];
    1.54 -                          if (rev > 0) 
    1.55 +                          if (rev > 0)
    1.56                                  {printf("%s %d\n",trees[tree],rev-1)}
    1.57                          }}' | while read LINE
    1.58      do
    1.59 @@ -1459,7 +1459,7 @@
    1.60  {
    1.61      TREE=$1
    1.62      HGCMD="hg -R $CWS/$TREE status $FSTAT_OPT"
    1.63 -    
    1.64 +
    1.65      $HGCMD -mdn 2>/dev/null | $FILTER | while read F
    1.66      do
    1.67          echo $TREE/$F
    1.68 @@ -1543,7 +1543,7 @@
    1.69  			 if (n == 0)
    1.70  				{ printf("A %s/%s\n",tree,$2)}
    1.71  			 else
    1.72 -				{ printf("A %s\n",$2)}; 
    1.73 +				{ printf("A %s\n",$2)};
    1.74  			 next}
    1.75  	/^ /		{n=index($1,tree);
    1.76  			 if (n == 0)
    1.77 @@ -1604,7 +1604,7 @@
    1.78  # We need at least one of default-push or default paths set in .hg/hgrc
    1.79  # If neither are set we don't know who to compare with.
    1.80  
    1.81 -function flist_from_mercurial 
    1.82 +function flist_from_mercurial
    1.83  {
    1.84  #	if [ "${PWS##ssh://}" != "$PWS" -o \
    1.85  #	     "${PWS##http://}" != "$PWS" -o \
    1.86 @@ -1757,7 +1757,7 @@
    1.87  	elif [[ "$OS" == "Linux" ]]; then
    1.88  	    DEVTOOLS="/java/devtools/linux/bin"
    1.89  	fi
    1.90 -	    
    1.91 +
    1.92  	ppath=$PATH
    1.93  	ppath=$ppath:/usr/sfw/bin:/usr/bin:/usr/sbin
    1.94  	ppath=$ppath:/opt/teamware/bin:/opt/onbld/bin
    1.95 @@ -1844,7 +1844,7 @@
    1.96  	ssh_host=`echo $CMD | sed -e 's/ssh:\/\/\([^/]*\)\/.*/\1/'`
    1.97  	ssh_dir=`echo $CMD | sed -e 's/ssh:\/\/[^/]*\/\(.*\)/\1/'`
    1.98      fi
    1.99 -    
   1.100 +
   1.101  }
   1.102  
   1.103  function build_old_new_mercurial
   1.104 @@ -2096,7 +2096,7 @@
   1.105  		PARENT_REV=$OPTARG;;
   1.106  
   1.107  	v)	print "$0 version: $WEBREV_UPDATED";;
   1.108 -		
   1.109 +
   1.110  
   1.111  	?)	usage;;
   1.112  	esac
   1.113 @@ -2338,7 +2338,7 @@
   1.114  	#
   1.115  	[[ -z $codemgr_ws && -n $CODEMGR_WS ]] && codemgr_ws=$CODEMGR_WS
   1.116  	[[ -z $codemgr_ws && -n $WSPACE ]] && codemgr_ws=`$WSPACE name`
   1.117 -	    
   1.118 +
   1.119  	if [[ -n $codemgr_ws && ! -d $codemgr_ws ]]; then
   1.120  		print -u2 "$codemgr_ws: no such workspace"
   1.121  		exit 1
   1.122 @@ -2521,10 +2521,16 @@
   1.123  #    Bug IDs will be replaced by a URL.  Order of precedence
   1.124  #    is: default location, $WEBREV_BUGURL, the -O flag.
   1.125  #
   1.126 -BUGURL='http://monaco.sfbay.sun.com/detail.jsp?cr='
   1.127 +BUGURL='https://jbs.oracle.com/bugs/browse/'
   1.128  [[ -n $WEBREV_BUGURL ]] && BUGURL="$WEBREV_BUGURL"
   1.129 -[[ -n "$Oflag" ]] && \
   1.130 +if [[ -n "$Oflag" ]]; then
   1.131 +    CRID=`echo $CRID | sed -e 's/JDK-//'`
   1.132      BUGURL='http://bugs.sun.com/bugdatabase/view_bug.do?bug_id='
   1.133 +    IDPREFIX=''
   1.134 +else
   1.135 +    IDPREFIX='JDK-'
   1.136 +fi
   1.137 +
   1.138  
   1.139  #
   1.140  #    Likewise, ARC cases will be replaced by a URL.  Order of precedence
   1.141 @@ -2561,7 +2567,7 @@
   1.142  
   1.143  #
   1.144  # Should we ignore changes in white spaces when generating diffs?
   1.145 -# 
   1.146 +#
   1.147  if [[ -n $bflag ]]; then
   1.148      DIFFOPTS="-t"
   1.149  else
   1.150 @@ -2748,7 +2754,7 @@
   1.151  		fi
   1.152  	    fi
   1.153  	else
   1.154 -	    
   1.155 +
   1.156  	    #
   1.157  	    # If we have old and new versions of the file then run the
   1.158  	    # appropriate diffs.  This is complicated by a couple of factors:
   1.159 @@ -3000,22 +3006,31 @@
   1.160  # external URL has a <title> like:
   1.161  # <title>Bug ID: 6641309 Wrong Cookie separator used in HttpURLConnection</title>
   1.162  # while internal URL has <title> like:
   1.163 -# <title>6641309: Wrong Cookie separator used in HttpURLConnection</title>
   1.164 +# <title>[#JDK-6641309] Wrong Cookie separator used in HttpURLConnection</title>
   1.165  #
   1.166  if [[ -n $CRID ]]; then
   1.167      for id in $CRID
   1.168      do
   1.169 +        if [[ -z "$Oflag" ]]; then
   1.170 +            #add "JDK-" to raw bug id for jbs links.
   1.171 +            id=`echo ${id} | sed 's/^\([0-9]\{5,\}\)$/JDK-\1/'`
   1.172 +        fi
   1.173          print "<tr><th>Bug id:</th><td>"
   1.174          url="${BUGURL}${id}"
   1.175 +        if [[ -n "$Oflag" ]]; then
   1.176 +            cleanup='s/Bug ID: \([0-9]\{5,\}\) \(.*\)/JDK-\1 : \2/'
   1.177 +        else
   1.178 +            cleanup='s|\[#\(JDK-[0-9]\{5,\}\)\] \(.*\)|\1 : \2|'
   1.179 +        fi
   1.180          if [[ -n $WGET ]]; then
   1.181 -            msg=`$WGET -q $url -O - | grep '<title>' | sed 's/<title>\(.*\)<\/title>/\1/' | sed 's/Bug ID://'`
   1.182 +            msg=`$WGET --timeout=10 --tries=1 -q $url -O - | grep '<title>' | sed 's/<title>\(.*\)<\/title>/\1/' | sed "$cleanup"`
   1.183          fi
   1.184 -        if [[ -n $msg ]]; then
   1.185 -            print "<a href=\"$url\">$msg</a>"
   1.186 -        else
   1.187 -            print $id | bug2url
   1.188 +        if [[ -z $msg ]]; then
   1.189 +            msg="${id}"
   1.190          fi
   1.191 -        
   1.192 +
   1.193 +        print "<a href=\"$url\">$msg</a>"
   1.194 +
   1.195          print "</td></tr>"
   1.196      done
   1.197  fi
   1.198 @@ -3179,4 +3194,3 @@
   1.199  
   1.200  print "Done."
   1.201  print "Output to: $WDIR"
   1.202 -

mercurial