make/scripts/webrev.ksh

changeset 851
9ec6626d43bb
parent 812
d23177734b28
child 907
c1029b02ca87
     1.1 --- a/make/scripts/webrev.ksh	Wed Oct 16 13:50:05 2013 +0200
     1.2 +++ b/make/scripts/webrev.ksh	Thu Oct 17 14:07:57 2013 -0700
     1.3 @@ -27,7 +27,7 @@
     1.4  # Documentation is available via 'webrev -h'.
     1.5  #
     1.6  
     1.7 -WEBREV_UPDATED=24.1-hg+openjdk.java.net
     1.8 +WEBREV_UPDATED=25.0-hg+openjdk.java.net
     1.9  
    1.10  HTML='<?xml version="1.0"?>
    1.11  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    1.12 @@ -39,7 +39,8 @@
    1.13      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
    1.14  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n'
    1.15  
    1.16 -STDHEAD='<meta http-equiv="cache-control" content="no-cache" />
    1.17 +STDHEAD='<meta charset="utf-8">
    1.18 +<meta http-equiv="cache-control" content="no-cache" />
    1.19  <meta http-equiv="Pragma" content="no-cache" />
    1.20  <meta http-equiv="Expires" content="-1" />
    1.21  <!--
    1.22 @@ -136,7 +137,19 @@
    1.23  #
    1.24  html_quote()
    1.25  {
    1.26 -	sed -e "s/&/\&amp;/g" -e "s/</\&lt;/g" -e "s/>/\&gt;/g" "$@" | expand
    1.27 +	sed -e "s/&/\&amp;/g" -e "s/&amp;#\([x]*[0-9A-Fa-f]\{2,5\}\);/\&#\1;/g" -e "s/</\&lt;/g" -e "s/>/\&gt;/g" "$@" | expand
    1.28 +}
    1.29 +
    1.30 +#
    1.31 +# input_cmd | html_quote | output_cmd
    1.32 +# or
    1.33 +# html_dequote filename | output_cmd
    1.34 +#
    1.35 +# Replace HTML entities with literals
    1.36 +#
    1.37 +html_dequote()
    1.38 +{
    1.39 +	sed -e "s/&quot;/\"/g" -e "s/&apos;/\'/g" -e "s/&amp;/\&/g" -e "s/&lt;/<'/g" -e "s/&gt;/>/g" "$@" | expand
    1.40  }
    1.41  
    1.42  #
    1.43 @@ -150,23 +163,6 @@
    1.44  }
    1.45  
    1.46  #
    1.47 -# input_cmd | sac2url | output_cmd
    1.48 -#
    1.49 -# Scan for ARC cases and insert <a> links to the relevent SAC database.
    1.50 -# This is slightly complicated because inside the SWAN, SAC cases are
    1.51 -# grouped by ARC: PSARC/2006/123.  But on OpenSolaris.org, they are
    1.52 -# referenced as 2006/123 (without labelling the ARC).
    1.53 -#
    1.54 -sac2url()
    1.55 -{
    1.56 -	if [[ -z $Oflag ]]; then
    1.57 -	    sed -e 's|\([A-Z]\{1,2\}ARC\)[ /]\([0-9]\{4\}\)/\([0-9]\{3\}\)|<a href=\"'$SACURL'\1/\2/\3\">\1 \2/\3</a>|g'
    1.58 -	else
    1.59 -	    sed -e 's|\([A-Z]\{1,2\}ARC\)[ /]\([0-9]\{4\}\)/\([0-9]\{3\}\)|<a href=\"'$SACURL'/\2/\3\">\1 \2/\3</a>|g'
    1.60 -	fi
    1.61 -}
    1.62 -
    1.63 -#
    1.64  # strip_unchanged <infile> | output_cmd
    1.65  #
    1.66  # Removes chunks of sdiff documents that have not changed. This makes it
    1.67 @@ -1055,79 +1051,6 @@
    1.68  	print "</pre></body></html>"
    1.69  }
    1.70  
    1.71 -#
    1.72 -# teamwarecomments {text|html} parent-file child-file
    1.73 -#
    1.74 -# Find the first delta in the child that's not in the parent.  Get the
    1.75 -# newest delta from the parent, get all deltas from the child starting
    1.76 -# with that delta, and then get all info starting with the second oldest
    1.77 -# delta in that list (the first delta unique to the child).
    1.78 -#
    1.79 -# This code adapted from Bill Shannon's "spc" script
    1.80 -#
    1.81 -comments_from_teamware()
    1.82 -{
    1.83 -	fmt=$1
    1.84 -	pfile=$PWS/$2
    1.85 -	cfile=$CWS/$3
    1.86 -
    1.87 -	psid=$($SCCS prs -d:I: $pfile 2>/dev/null)
    1.88 -	if [[ -z "$psid" ]]; then
    1.89 -	    psid=1.1
    1.90 -	fi
    1.91 -
    1.92 -	set -A sids $($SCCS prs -l -r$psid -d:I: $cfile 2>/dev/null)
    1.93 -	N=${#sids[@]}
    1.94 -
    1.95 -	nawkprg='
    1.96 -		/^COMMENTS:/	{p=1; next}
    1.97 -		/^D [0-9]+\.[0-9]+/ {printf "--- %s ---\n", $2; p=0; }
    1.98 -		NF == 0u	{ next }
    1.99 -		{if (p==0) next; print $0 }'
   1.100 -
   1.101 -	if [[ $N -ge 2 ]]; then
   1.102 -		sid1=${sids[$((N-2))]}	# Gets 2nd to last sid
   1.103 -
   1.104 -		if [[ $fmt == "text" ]]; then
   1.105 -			$SCCS prs -l -r$sid1 $cfile  2>/dev/null | \
   1.106 -			    $AWK "$nawkprg"
   1.107 -			return
   1.108 -		fi
   1.109 -
   1.110 -		$SCCS prs -l -r$sid1 $cfile  2>/dev/null | \
   1.111 -		    html_quote | bug2url | sac2url | $AWK "$nawkprg"
   1.112 -	fi
   1.113 -}
   1.114 -
   1.115 -#
   1.116 -# wxcomments {text|html} filepath
   1.117 -#
   1.118 -# Given the pathname of a file, find its location in a "wx" active file
   1.119 -# list and print the following sccs comment.  Output is either text or
   1.120 -# HTML; if the latter, embedded bugids (sequence of 5 or more digits) are
   1.121 -# turned into URLs.
   1.122 -#
   1.123 -comments_from_wx()
   1.124 -{
   1.125 -	typeset fmt=$1
   1.126 -	typeset p=$2
   1.127 -
   1.128 -	comm=`$AWK '
   1.129 -	$1 == "'$p'" {
   1.130 -		do getline ; while (NF > 0)
   1.131 -		getline
   1.132 -		while (NF > 0) { print ; getline }
   1.133 -		exit
   1.134 -	}' < $wxfile`
   1.135 -
   1.136 -	if [[ $fmt == "text" ]]; then
   1.137 -		print "$comm"
   1.138 -		return
   1.139 -	fi
   1.140 -
   1.141 -	print "$comm" | html_quote | bug2url | sac2url
   1.142 -}
   1.143 -
   1.144  comments_from_mercurial()
   1.145  {
   1.146  	fmt=$1
   1.147 @@ -1161,7 +1084,7 @@
   1.148  	            return
   1.149  	        fi
   1.150  
   1.151 -	        print "$comm" | html_quote | bug2url | sac2url
   1.152 +	        print "$comm" | html_quote | bug2url
   1.153                  )
   1.154          fi
   1.155  }
   1.156 @@ -1178,15 +1101,7 @@
   1.157  	typeset p=$2
   1.158  	typeset pp=$3
   1.159  
   1.160 -	if [[ -n $wxfile ]]; then
   1.161 -		comments_from_wx $fmt $p
   1.162 -	else
   1.163 -		if [[ $SCM_MODE == "teamware" ]]; then
   1.164 -			comments_from_teamware $fmt $pp $p
   1.165 -		elif [[ $SCM_MODE == "mercurial" ]]; then
   1.166 -			comments_from_mercurial $fmt $pp $p
   1.167 -		fi
   1.168 -	fi
   1.169 +	comments_from_mercurial $fmt $pp $p
   1.170  }
   1.171  
   1.172  #
   1.173 @@ -1333,74 +1248,6 @@
   1.174  	print "</span>"
   1.175  }
   1.176  
   1.177 -
   1.178 -#
   1.179 -# flist_from_wx
   1.180 -#
   1.181 -# Sets up webrev to source its information from a wx-formatted file.
   1.182 -# Sets the global 'wxfile' variable.
   1.183 -#
   1.184 -function flist_from_wx
   1.185 -{
   1.186 -	typeset argfile=$1
   1.187 -	if [[ -n ${argfile%%/*} ]]; then
   1.188 -		#
   1.189 -		# If the wx file pathname is relative then make it absolute
   1.190 -		# because the webrev does a "cd" later on.
   1.191 -		#
   1.192 -		wxfile=$PWD/$argfile
   1.193 -	else
   1.194 -		wxfile=$argfile
   1.195 -	fi
   1.196 -
   1.197 -	$AWK '{ c = 1; print;
   1.198 -	  while (getline) {
   1.199 -		if (NF == 0) { c = -c; continue }
   1.200 -		if (c > 0) print
   1.201 -	  }
   1.202 -	}' $wxfile > $FLIST
   1.203 -
   1.204 -	print " Done."
   1.205 -}
   1.206 -
   1.207 -#
   1.208 -# flist_from_teamware [ <args-to-putback-n> ]
   1.209 -#
   1.210 -# Generate the file list by extracting file names from a putback -n.  Some
   1.211 -# names may come from the "update/create" messages and others from the
   1.212 -# "currently checked out" warning.  Renames are detected here too.  Extract
   1.213 -# values for CODEMGR_WS and CODEMGR_PARENT from the output of the putback
   1.214 -# -n as well, but remove them if they are already defined.
   1.215 -#
   1.216 -function flist_from_teamware
   1.217 -{
   1.218 -	if [[ -n $codemgr_parent ]]; then
   1.219 -		if [[ ! -d $codemgr_parent/Codemgr_wsdata ]]; then
   1.220 -			print -u2 "parent $codemgr_parent doesn't look like a" \
   1.221 -			    "valid teamware workspace"
   1.222 -			exit 1
   1.223 -		fi
   1.224 -		parent_args="-p $codemgr_parent"
   1.225 -	fi
   1.226 -
   1.227 -	print " File list from: 'putback -n $parent_args $*' ... \c"
   1.228 -
   1.229 -	putback -n $parent_args $* 2>&1 |
   1.230 -	    $AWK '
   1.231 -		/^update:|^create:/	{print $2}
   1.232 -		/^Parent workspace:/	{printf("CODEMGR_PARENT=%s\n",$3)}
   1.233 -		/^Child workspace:/	{printf("CODEMGR_WS=%s\n",$3)}
   1.234 -		/^The following files are currently checked out/ {p = 1; next}
   1.235 -		NF == 0			{p=0 ; next}
   1.236 -		/^rename/		{old=$3}
   1.237 -		$1 == "to:"		{print $2, old}
   1.238 -		/^"/			{next}
   1.239 -		p == 1			{print $1}' |
   1.240 -	    sort -r -k 1,1 -u | sort > $FLIST
   1.241 -
   1.242 -	print " Done."
   1.243 -}
   1.244 -
   1.245  function outgoing_from_mercurial_forest
   1.246  {
   1.247      hg foutgoing --template 'rev: {rev}\n' $OUTPWS | $FILTER | $AWK '
   1.248 @@ -1710,47 +1557,13 @@
   1.249  #
   1.250  function detect_scm
   1.251  {
   1.252 -	#
   1.253 -	# If CODEMGR_WS is specified in the flist file, we assume teamware.
   1.254 -	#
   1.255 -	if [[ -r $FLIST ]]; then
   1.256 -		egrep '^CODEMGR_WS=' $FLIST > /dev/null 2>&1
   1.257 -		if [[ $? -eq 0 ]]; then
   1.258 -			print "teamware"
   1.259 -			return
   1.260 -		fi
   1.261 -	fi
   1.262 -
   1.263 -	#
   1.264 -	# The presence of $CODEMGR_WS and a Codemgr_wsdata directory
   1.265 -	# is our clue that this is a teamware workspace.
   1.266 -	# Same if true if current directory has a Codemgr_wsdata sub-dir
   1.267 -	#
   1.268 -	if [[ -z "$CODEMGR_WS" ]]; then
   1.269 -	    CODEMGR_WS=`workspace name 2>/dev/null`
   1.270 -	fi
   1.271 -
   1.272 -	if [[ -n $CODEMGR_WS && -d "$CODEMGR_WS/Codemgr_wsdata" ]]; then
   1.273 -		print "teamware"
   1.274 -	elif [[ -d $PWD/Codemgr_wsdata ]]; then
   1.275 -		print "teamware"
   1.276 -	elif hg root >/dev/null ; then
   1.277 +	if hg root >/dev/null ; then
   1.278  		print "mercurial"
   1.279  	else
   1.280  		print "unknown"
   1.281  	fi
   1.282  }
   1.283  
   1.284 -#
   1.285 -# Extract the parent workspace from the Codemgr_wsdata/parent file
   1.286 -#
   1.287 -function parent_from_teamware
   1.288 -{
   1.289 -    if [[ -f "$1/Codemgr_wsdata/parent" ]]; then
   1.290 -	tail -1 "$1/Codemgr_wsdata/parent"
   1.291 -    fi
   1.292 -}
   1.293 -
   1.294  function look_for_prog
   1.295  {
   1.296  	typeset path
   1.297 @@ -1777,48 +1590,6 @@
   1.298  	fi
   1.299  }
   1.300  
   1.301 -function build_old_new_teamware
   1.302 -{
   1.303 -	# If the child's version doesn't exist then
   1.304 -	# get a readonly copy.
   1.305 -
   1.306 -	if [[ ! -f $F && -f SCCS/s.$F ]]; then
   1.307 -		$SCCS get -s $F
   1.308 -	fi
   1.309 -
   1.310 -	#
   1.311 -	# Snag new version of file.
   1.312 -	#
   1.313 -	rm -f $newdir/$DIR/$F
   1.314 -	cp $F $newdir/$DIR/$F
   1.315 -
   1.316 -	#
   1.317 -	# Get the parent's version of the file. First see whether the
   1.318 -	# child's version is checked out and get the parent's version
   1.319 -	# with keywords expanded or unexpanded as appropriate.
   1.320 -	#
   1.321 -	if [ -f $PWS/$PDIR/SCCS/s.$PF -o \
   1.322 -	    -f $PWS/$PDIR/SCCS/p.$PF ]; then
   1.323 -		rm -f $olddir/$PDIR/$PF
   1.324 -		if [ -f SCCS/p.$F ]; then
   1.325 -			$SCCS get -s -p -k $PWS/$PDIR/$PF \
   1.326 -			    > $olddir/$PDIR/$PF
   1.327 -		else
   1.328 -			$SCCS get -s -p    $PWS/$PDIR/$PF \
   1.329 -			    > $olddir/$PDIR/$PF
   1.330 -		fi
   1.331 -	else
   1.332 -		if [[ -f $PWS/$PDIR/$PF ]]; then
   1.333 -			# Parent is not a real workspace, but just a raw
   1.334 -			# directory tree - use the file that's there as
   1.335 -			# the old file.
   1.336 -
   1.337 -			rm -f $olddir/$DIR/$F
   1.338 -			cp $PWS/$PDIR/$PF $olddir/$DIR/$F
   1.339 -		fi
   1.340 -	fi
   1.341 -}
   1.342 -
   1.343  #
   1.344  # Find the parent for $1
   1.345  #
   1.346 @@ -1938,10 +1709,6 @@
   1.347  
   1.348  function build_old_new
   1.349  {
   1.350 -	if [[ $SCM_MODE == "teamware" ]]; then
   1.351 -		build_old_new_teamware $@
   1.352 -	fi
   1.353 -
   1.354  	if [[ $SCM_MODE == "mercurial" ]]; then
   1.355  		build_old_new_mercurial $@
   1.356  	fi
   1.357 @@ -1953,37 +1720,31 @@
   1.358  #
   1.359  function usage
   1.360  {
   1.361 -	print "Usage:\twebrev [common-options]
   1.362 -	webrev [common-options] ( <file> | - )
   1.363 -	webrev [common-options] -w <wx file>
   1.364 -	webrev [common-options] -l [arguments to 'putback']
   1.365 +	print "Usage:\twebrev [options]
   1.366 +	webrev [options] ( <file> | - )
   1.367  
   1.368  Options:
   1.369  	-v: Print the version of this tool.
   1.370          -b: Do not ignore changes in the amount of white space.
   1.371          -c <CR#>: Include link to CR (aka bugid) in the main page.
   1.372 -	-O: Print bugids/arc cases suitable for OpenJDK.
   1.373  	-i <filename>: Include <filename> in the index.html file.
   1.374  	-o <outdir>: Output webrev to specified directory.
   1.375  	-p <compare-against>: Use specified parent wkspc or basis for comparison
   1.376 -	-w <wxfile>: Use specified wx active file.
   1.377          -u <username>: Use that username instead of 'guessing' one.
   1.378  	-m: Forces the use of Mercurial
   1.379 -	-t: Forces the use of Teamware
   1.380  
   1.381  Mercurial only options:
   1.382  	-r rev: Compare against a specified revision
   1.383  	-N: Skip 'hg outgoing', use only 'hg status'
   1.384  	-f: Use the forest extension
   1.385  
   1.386 +Arguments:
   1.387 +	<file>: Optional file containing list of files to include in webrev
   1.388 +        -: read list of files to include in webrev from standard input
   1.389 +
   1.390  Environment:
   1.391  	WDIR: Control the output directory.
   1.392  	WEBREV_BUGURL: Control the URL prefix for bugids.
   1.393 -	WEBREV_SACURL: Control the URL prefix for ARC cases.
   1.394 -
   1.395 -SCM Environment:
   1.396 -	Teamware: CODEMGR_WS: Workspace location.
   1.397 -	Teamware: CODEMGR_PARENT: Parent workspace location.
   1.398  
   1.399  "
   1.400  
   1.401 @@ -2003,7 +1764,6 @@
   1.402  set +o noclobber
   1.403  
   1.404  [[ -z $WDIFF ]] && WDIFF=`look_for_prog wdiff`
   1.405 -[[ -z $WX ]] && WX=`look_for_prog wx`
   1.406  [[ -z $CODEREVIEW ]] && CODEREVIEW=`look_for_prog codereview`
   1.407  [[ -z $PS2PDF ]] && PS2PDF=`look_for_prog ps2pdf`
   1.408  [[ -z $PERL ]] && PERL=`look_for_prog perl`
   1.409 @@ -2011,7 +1771,6 @@
   1.410  [[ -z $AWK ]] && AWK=`look_for_prog nawk`
   1.411  [[ -z $AWK ]] && AWK=`look_for_prog gawk`
   1.412  [[ -z $AWK ]] && AWK=`look_for_prog awk`
   1.413 -[[ -z $WSPACE ]] && WSPACE=`look_for_prog workspace`
   1.414  [[ -z $JAR ]] && JAR=`look_for_prog jar`
   1.415  [[ -z $ZIP ]] && ZIP=`look_for_prog zip`
   1.416  [[ -z $GETENT ]] && GETENT=`look_for_prog getent`
   1.417 @@ -2033,8 +1792,6 @@
   1.418  
   1.419  #
   1.420  # These aren't fatal, but we want to note them to the user.
   1.421 -# We don't warn on the absence of 'wx' until later when we've
   1.422 -# determined that we actually need to try to invoke it.
   1.423  #
   1.424  # [[ ! -x $CODEREVIEW ]] && print -u2 "WARNING: codereview(1) not found."
   1.425  # [[ ! -x $PS2PDF ]] && print -u2 "WARNING: ps2pdf(1) not found."
   1.426 @@ -2050,13 +1807,11 @@
   1.427  oflag=
   1.428  pflag=
   1.429  uflag=
   1.430 -lflag=
   1.431 -wflag=
   1.432  Oflag=
   1.433  rflag=
   1.434  Nflag=
   1.435  forestflag=
   1.436 -while getopts "c:i:o:p:r:u:lmtwONvfb" opt
   1.437 +while getopts "c:i:o:p:r:u:mONvfb" opt
   1.438  do
   1.439  	case $opt in
   1.440          b)      bflag=1;;
   1.441 @@ -2081,19 +1836,7 @@
   1.442  
   1.443  	m)	SCM_MODE="mercurial";;
   1.444  
   1.445 -	t)	SCM_MODE="teamware";;
   1.446 -
   1.447 -	#
   1.448 -	# If -l has been specified, we need to abort further options
   1.449 -	# processing, because subsequent arguments are going to be
   1.450 -	# arguments to 'putback -n'.
   1.451 -	#
   1.452 -	l)	lflag=1
   1.453 -		break;;
   1.454 -
   1.455 -	w)	wflag=1;;
   1.456 -
   1.457 -	O)	Oflag=1;;
   1.458 +	O)	Oflag=1;; # ignored (bugs are now all visible at bugs.openjdk.java.net)
   1.459  
   1.460  	N)	Nflag=1;;
   1.461  
   1.462 @@ -2112,10 +1855,6 @@
   1.463  FLIST=/tmp/$$.flist
   1.464  HG_LIST_FROM_COMMIT=
   1.465  
   1.466 -if [[ -n $wflag && -n $lflag ]]; then
   1.467 -	usage
   1.468 -fi
   1.469 -
   1.470  if [[ -n $forestflag && -n $rflag ]]; then
   1.471      print "The -r <rev> flag is incompatible with the use of forests"
   1.472      exit 2
   1.473 @@ -2130,27 +1869,25 @@
   1.474  	codemgr_parent="$codemgr_parent/raw_files/new"
   1.475  fi
   1.476  
   1.477 -if [[ -z $wflag && -z $lflag ]]; then
   1.478 -	shift $(($OPTIND - 1))
   1.479 +shift $(($OPTIND - 1))
   1.480  
   1.481 -	if [[ $1 == "-" ]]; then
   1.482 -		cat > $FLIST
   1.483 -		flist_mode="stdin"
   1.484 -		flist_done=1
   1.485 -		shift
   1.486 -	elif [[ -n $1 ]]; then
   1.487 -		if [[ ! -r $1 ]]; then
   1.488 -			print -u2 "$1: no such file or not readable"
   1.489 -			usage
   1.490 -		fi
   1.491 -		cat $1 > $FLIST
   1.492 -		flist_mode="file"
   1.493 -		flist_file=$1
   1.494 -		flist_done=1
   1.495 -		shift
   1.496 -	else
   1.497 -		flist_mode="auto"
   1.498 +if [[ $1 == "-" ]]; then
   1.499 +	cat > $FLIST
   1.500 +	flist_mode="stdin"
   1.501 +	flist_done=1
   1.502 +	shift
   1.503 +elif [[ -n $1 ]]; then
   1.504 +	if [[ ! -r $1 ]]; then
   1.505 +		print -u2 "$1: no such file or not readable"
   1.506 +		usage
   1.507  	fi
   1.508 +	cat $1 > $FLIST
   1.509 +	flist_mode="file"
   1.510 +	flist_file=$1
   1.511 +	flist_done=1
   1.512 +	shift
   1.513 +else
   1.514 +	flist_mode="auto"
   1.515  fi
   1.516  
   1.517  #
   1.518 @@ -2161,11 +1898,9 @@
   1.519      SCM_MODE=`detect_scm $FLIST`
   1.520  fi
   1.521  if [[ $SCM_MODE == "unknown" ]]; then
   1.522 -	print -u2 "Unable to determine SCM type currently in use."
   1.523 -	print -u2 "For teamware: webrev looks for \$CODEMGR_WS either in"
   1.524 -	print -u2 "              the environment or in the file list."
   1.525 -	print -u2 "For mercurial: webrev runs 'hg root'."
   1.526 -	exit 1
   1.527 +       print -u2 "Unable to determine SCM type currently in use."
   1.528 +       print -u2 "For mercurial: webrev runs 'hg root'."
   1.529 +       exit 1
   1.530  fi
   1.531  
   1.532  print -u2 "   SCM detected: $SCM_MODE"
   1.533 @@ -2199,7 +1934,7 @@
   1.534              #
   1.535              # for forest we have to rely on properly set default and
   1.536              # default-push because they can be different from the top one.
   1.537 -            # unless of course it was explicitely speficied with -p
   1.538 +            # unless of course it was explicitly specified with -p
   1.539              if [[ -z $pflag ]]; then
   1.540                  OUTPWS=
   1.541              fi
   1.542 @@ -2281,46 +2016,7 @@
   1.543      fi
   1.544  fi
   1.545  
   1.546 -if [[ -n $lflag ]]; then
   1.547 -	#
   1.548 -	# If the -l flag is given instead of the name of a file list,
   1.549 -	# then generate the file list by extracting file names from a
   1.550 -	# putback -n.
   1.551 -	#
   1.552 -	shift $(($OPTIND - 1))
   1.553 -	if [[ $SCM_MODE == "teamware" ]]; then
   1.554 -		flist_from_teamware "$*"
   1.555 -	elif [[ $SCM_MODE == "mercurial" ]]; then
   1.556 -		flist_from_mercurial
   1.557 -	fi
   1.558 -	flist_done=1
   1.559 -	shift $#
   1.560 -
   1.561 -elif [[ -n $wflag ]]; then
   1.562 -	#
   1.563 -	# If the -w is given then assume the file list is in Bonwick's "wx"
   1.564 -	# command format, i.e.  pathname lines alternating with SCCS comment
   1.565 -	# lines with blank lines as separators.  Use the SCCS comments later
   1.566 -	# in building the index.html file.
   1.567 -	#
   1.568 -	shift $(($OPTIND - 1))
   1.569 -	wxfile=$1
   1.570 -	if [[ -z $wxfile && -n $CODEMGR_WS ]]; then
   1.571 -		if [[ -r $CODEMGR_WS/wx/active ]]; then
   1.572 -			wxfile=$CODEMGR_WS/wx/active
   1.573 -		fi
   1.574 -	fi
   1.575 -
   1.576 -	[[ -z $wxfile ]] && print -u2 "wx file not specified, and could not " \
   1.577 -	    "be auto-detected (check \$CODEMGR_WS)" && exit 1
   1.578 -
   1.579 -	print -u2 " File list from: wx 'active' file '$wxfile' ... \c"
   1.580 -	flist_from_wx $wxfile
   1.581 -	flist_done=1
   1.582 -	if [[ -n "$*" ]]; then
   1.583 -		shift
   1.584 -	fi
   1.585 -elif [[ $flist_mode == "stdin" ]]; then
   1.586 +if [[ $flist_mode == "stdin" ]]; then
   1.587  	print -u2 " File list from: standard input"
   1.588  elif [[ $flist_mode == "file" ]]; then
   1.589  	print -u2 " File list from: $flist_file"
   1.590 @@ -2330,110 +2026,7 @@
   1.591  	print -u2 "WARNING: unused arguments: $*"
   1.592  fi
   1.593  
   1.594 -if [[ $SCM_MODE == "teamware" ]]; then
   1.595 -	#
   1.596 -	# Parent (internally $codemgr_parent) and workspace ($codemgr_ws) can
   1.597 -	# be set in a number of ways, in decreasing precedence:
   1.598 -	#
   1.599 -	#      1) on the command line (only for the parent)
   1.600 -	#      2) in the user environment
   1.601 -	#      3) in the flist
   1.602 -	#      4) automatically based on the workspace (only for the parent)
   1.603 -	#
   1.604 -
   1.605 -	#
   1.606 -	# Here is case (2): the user environment
   1.607 -	#
   1.608 -	[[ -z $codemgr_ws && -n $CODEMGR_WS ]] && codemgr_ws=$CODEMGR_WS
   1.609 -	[[ -z $codemgr_ws && -n $WSPACE ]] && codemgr_ws=`$WSPACE name`
   1.610 -
   1.611 -	if [[ -n $codemgr_ws && ! -d $codemgr_ws ]]; then
   1.612 -		print -u2 "$codemgr_ws: no such workspace"
   1.613 -		exit 1
   1.614 -	fi
   1.615 -
   1.616 -	[[ -z $codemgr_parent && -n $CODEMGR_PARENT ]] && \
   1.617 -	    codemgr_parent=$CODEMGR_PARENT
   1.618 -
   1.619 -	if [[ -n $codemgr_parent && ! -d $codemgr_parent ]]; then
   1.620 -		print -u2 "$codemgr_parent: no such directory"
   1.621 -		exit 1
   1.622 -	fi
   1.623 -
   1.624 -	#
   1.625 -	# If we're in auto-detect mode and we haven't already gotten the file
   1.626 -	# list, then see if we can get it by probing for wx.
   1.627 -	#
   1.628 -	if [[ -z $flist_done && $flist_mode == "auto" && -n $codemgr_ws ]]; then
   1.629 -		if [[ ! -x $WX ]]; then
   1.630 -			print -u2 "WARNING: wx not found!"
   1.631 -		fi
   1.632 -
   1.633 -		#
   1.634 -		# We need to use wx list -w so that we get renamed files, etc.
   1.635 -		# but only if a wx active file exists-- otherwise wx will
   1.636 -		# hang asking us to initialize our wx information.
   1.637 -		#
   1.638 -		if [[ -x $WX && -f $codemgr_ws/wx/active ]]; then
   1.639 -			print -u2 " File list from: 'wx list -w' ... \c"
   1.640 -			$WX list -w > $FLIST
   1.641 -			$WX comments > /tmp/$$.wx_comments
   1.642 -			wxfile=/tmp/$$.wx_comments
   1.643 -			print -u2 "done"
   1.644 -			flist_done=1
   1.645 -		fi
   1.646 -	fi
   1.647 -
   1.648 -	#
   1.649 -	# If by hook or by crook we've gotten a file list by now (perhaps
   1.650 -	# from the command line), eval it to extract environment variables from
   1.651 -	# it: This is step (3).
   1.652 -	#
   1.653 -	env_from_flist
   1.654 -
   1.655 -	#
   1.656 -	# Continuing step (3): If we still have no file list, we'll try to get
   1.657 -	# it from teamware.
   1.658 -	#
   1.659 -	if [[ -z $flist_done ]]; then
   1.660 -		flist_from_teamware
   1.661 -		env_from_flist
   1.662 -	fi
   1.663 -
   1.664 -	if [[ -z $codemgr_ws && -d $PWD/Codemgr_wsdata ]]; then
   1.665 -	    codemgr_ws=$PWD
   1.666 -	fi
   1.667 -	#
   1.668 -	# Observe true directory name of CODEMGR_WS, as used later in
   1.669 -	# webrev title.
   1.670 -	#
   1.671 -	if [[ -n $codemgr_ws ]]; then
   1.672 -	    codemgr_ws=$(cd $codemgr_ws;print $PWD)
   1.673 -	fi
   1.674 -
   1.675 -	if [[ -n $codemgr_parent ]]; then
   1.676 -	    codemgr_parent=$(cd $codemgr_parent;print $PWD)
   1.677 -	fi
   1.678 -
   1.679 -	#
   1.680 -	# (4) If we still don't have a value for codemgr_parent, get it
   1.681 -	# from workspace.
   1.682 -	#
   1.683 -	[[ -z $codemgr_parent && -n $WSPACE ]] && codemgr_parent=`$WSPACE parent`
   1.684 -	[[ -z $codemgr_parent ]] && codemgr_parent=`parent_from_teamware $codemgr_ws`
   1.685 -
   1.686 -	if [[ ! -d $codemgr_parent ]]; then
   1.687 -	    print -u2 "$CODEMGR_PARENT: no such parent workspace"
   1.688 -	    exit 1
   1.689 -	fi
   1.690 -
   1.691 -	#
   1.692 -	# Reset CODEMGR_WS to make sure teamware commands are happy.
   1.693 -	#
   1.694 -	CODEMGR_WS=$codemgr_ws
   1.695 -	CWS=$codemgr_ws
   1.696 -	PWS=$codemgr_parent
   1.697 -elif [[ $SCM_MODE == "mercurial" ]]; then
   1.698 +if [[ $SCM_MODE == "mercurial" ]]; then
   1.699      if [[ -z $flist_done ]]; then
   1.700  	flist_from_mercurial $PWS
   1.701      fi
   1.702 @@ -2527,31 +2120,13 @@
   1.703  
   1.704  #
   1.705  #    Bug IDs will be replaced by a URL.  Order of precedence
   1.706 -#    is: default location, $WEBREV_BUGURL, the -O flag.
   1.707 +#    is: default location, $WEBREV_BUGURL
   1.708  #
   1.709  BUGURL='https://bugs.openjdk.java.net/browse/'
   1.710  [[ -n $WEBREV_BUGURL ]] && BUGURL="$WEBREV_BUGURL"
   1.711 -if [[ -n "$Oflag" ]]; then
   1.712 -    CRID=`echo $CRID | sed -e 's/JDK-//'`
   1.713 -    BUGURL='http://bugs.sun.com/bugdatabase/view_bug.do?bug_id='
   1.714 -    IDPREFIX=''
   1.715 -else
   1.716 -    IDPREFIX='JDK-'
   1.717 -fi
   1.718 +IDPREFIX='JDK-'
   1.719  
   1.720  
   1.721 -#
   1.722 -#    Likewise, ARC cases will be replaced by a URL.  Order of precedence
   1.723 -#    is: default, $WEBREV_SACURL, the -O flag.
   1.724 -#
   1.725 -#    Note that -O also triggers different substitution behavior for
   1.726 -#    SACURL.  See sac2url().
   1.727 -#
   1.728 -SACURL='http://sac.eng.sun.com'
   1.729 -[[ -n $WEBREV_SACURL ]] && SACURL="$WEBREV_SACURL"
   1.730 -[[ -n $Oflag ]] && \
   1.731 -    SACURL='http://www.opensolaris.org/os/community/arc/caselog'
   1.732 -
   1.733  rm -f $WDIR/$WNAME.patch
   1.734  rm -f $WDIR/$WNAME.changeset
   1.735  rm -f $WDIR/$WNAME.ps
   1.736 @@ -2651,20 +2226,6 @@
   1.737  	cd $CWS/$DIR
   1.738  
   1.739  	#
   1.740 -	# If we're in OpenSolaris mode, we enforce a minor policy:
   1.741 -	# help to make sure the reviewer doesn't accidentally publish
   1.742 -	# source which is in usr/closed/*
   1.743 -	#
   1.744 -	if [[ -n $Oflag ]]; then
   1.745 -		pclosed=${P##usr/closed/}
   1.746 -		if [[ $pclosed != $P ]]; then
   1.747 -			print "*** Omitting closed source for OpenSolaris" \
   1.748 -			    "mode review"
   1.749 -			continue
   1.750 -		fi
   1.751 -	fi
   1.752 -
   1.753 -	#
   1.754  	# We stash old and new files into parallel directories in /tmp
   1.755  	# and do our diffs there.  This makes it possible to generate
   1.756  	# clean looking diffs which don't have absolute paths present.
   1.757 @@ -2968,18 +2529,15 @@
   1.758  
   1.759  print "<table>"
   1.760  
   1.761 -if [[ -z $uflag ]]
   1.762 -then
   1.763 -    if [[ $SCM_MODE == "mercurial" ]]
   1.764 -    then
   1.765 +if [[ -z $uflag ]]; then
   1.766 +    if [[ $SCM_MODE == "mercurial" ]]; then
   1.767          #
   1.768          # Let's try to extract the user name from the .hgrc file
   1.769          #
   1.770  	username=`grep '^username' $HOME/.hgrc | sed 's/^username[ ]*=[ ]*\(.*\)/\1/'`
   1.771      fi
   1.772  
   1.773 -    if [[ -z $username ]]
   1.774 -    then
   1.775 +    if [[ -z $username ]]; then
   1.776          #
   1.777          # Figure out the username and gcos name.  To maintain compatibility
   1.778          # with passwd(4), we must support '&' substitutions.
   1.779 @@ -3047,27 +2605,21 @@
   1.780  	print "</div></td></tr>"
   1.781  fi
   1.782  # Add links to referenced CRs, if any
   1.783 -# external URL has a <title> like:
   1.784 -# <title>Bug ID: 6641309 Wrong Cookie separator used in HttpURLConnection</title>
   1.785 -# while internal URL has <title> like:
   1.786 -# <title>[#JDK-6641309] Wrong Cookie separator used in HttpURLConnection</title>
   1.787 -#
   1.788 +# URL has a <title> like:
   1.789 +# <title>[#JDK-8024688] b106-lambda: j.u.Map.merge doesn&#39;t work as specified if contains key:null pair - Java Bug System</title>
   1.790 +# we format this to:
   1.791 +# JDK-8024688: b106-lambda: j.u.Map.merge doesn't work as specified if contains key:null pair
   1.792  if [[ -n $CRID ]]; then
   1.793      for id in $CRID
   1.794      do
   1.795 -        if [[ -z "$Oflag" ]]; then
   1.796 -            #add "JDK-" to raw bug id for openjdk.java.net links.
   1.797 -            id=`echo ${id} | sed 's/^\([0-9]\{5,\}\)$/JDK-\1/'`
   1.798 -        fi
   1.799 +        #add "JDK-" to raw bug id for openjdk.java.net links.
   1.800 +        id=`echo ${id} | sed 's/^\([0-9]\{5,\}\)$/JDK-\1/'`
   1.801 +
   1.802          print "<tr><th>Bug id:</th><td>"
   1.803          url="${BUGURL}${id}"
   1.804 -        if [[ -n "$Oflag" ]]; then
   1.805 -            cleanup='s/Bug ID: \([0-9]\{5,\}\) \(.*\)/JDK-\1 : \2/'
   1.806 -        else
   1.807 -            cleanup='s|\[#\(JDK-[0-9]\{5,\}\)\] \(.*\)|\1 : \2|'
   1.808 -        fi
   1.809 +
   1.810          if [[ -n $WGET ]]; then
   1.811 -            msg=`$WGET --timeout=10 --tries=1 -q $url -O - | grep '<title>' | sed 's/<title>\(.*\)<\/title>/\1/' | sed "$cleanup" | html_quote`
   1.812 +            msg=`$WGET --timeout=10 --tries=1 -q $url -O - | grep '<title>' | sed 's/<title>\[#\(.*\)\] \(.*\) - Java Bug System<\/title>/\1 : \2/' | html_dequote | html_quote`
   1.813          fi
   1.814          if [[ -z $msg ]]; then
   1.815              msg="${id}"
   1.816 @@ -3184,16 +2736,6 @@
   1.817  	    print "<b>$P</b> $oldname"
   1.818          fi
   1.819  
   1.820 -	#
   1.821 -	# Check for usr/closed
   1.822 -	#
   1.823 -	if [ ! -z "$Oflag" ]; then
   1.824 -		if [[ $P == usr/closed/* ]]; then
   1.825 -			print "&nbsp;&nbsp;<i>Closed source: omitted from" \
   1.826 -			    "this review</i>"
   1.827 -		fi
   1.828 -	fi
   1.829 -
   1.830  	print "</p><blockquote>\c"
   1.831  	# Insert delta comments if any
   1.832  	comments=`getcomments html $P $PP`

mercurial