webrev.sh (9d3952ab10f8677fdabc8594d26cc1e7d6acdfc4) | webrev.sh (78add226e8da271dde8f3b5a91d340d1bf010151) |
---|---|
1#!/usr/bin/ksh93 -p 2# 3# CDDL HEADER START 4# 5# The contents of this file are subject to the terms of the 6# Common Development and Distribution License (the "License"). 7# You may not use this file except in compliance with the License. 8# --- 7 unchanged lines hidden (view full) --- 16# If applicable, add the following below this CDDL HEADER, with the 17# fields enclosed by brackets "[]" replaced with your own identifying 18# information: Portions Copyright [yyyy] [name of copyright owner] 19# 20# CDDL HEADER END 21# 22 23# | 1#!/usr/bin/ksh93 -p 2# 3# CDDL HEADER START 4# 5# The contents of this file are subject to the terms of the 6# Common Development and Distribution License (the "License"). 7# You may not use this file except in compliance with the License. 8# --- 7 unchanged lines hidden (view full) --- 16# If applicable, add the following below this CDDL HEADER, with the 17# fields enclosed by brackets "[]" replaced with your own identifying 18# information: Portions Copyright [yyyy] [name of copyright owner] 19# 20# CDDL HEADER END 21# 22 23# |
24# Copyright 2010 Sun Microsystems, Inc. All rights reserved. 25# Use is subject to license terms. | 24# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. |
26# 27 28# 29# This script takes a file list and a workspace and builds a set of html files 30# suitable for doing a code review of source changes via a web page. 31# Documentation is available via the manual page, webrev.1, or just 32# type 'webrev -h'. 33# --- 1728 unchanged lines hidden (view full) --- 1762# flist_from_wx 1763# 1764function flist_from_mercurial 1765{ 1766 typeset child=$1 1767 typeset parent=$2 1768 1769 print " File list from: hg-active -p $parent ...\c" | 25# 26 27# 28# This script takes a file list and a workspace and builds a set of html files 29# suitable for doing a code review of source changes via a web page. 30# Documentation is available via the manual page, webrev.1, or just 31# type 'webrev -h'. 32# --- 1728 unchanged lines hidden (view full) --- 1761# flist_from_wx 1762# 1763function flist_from_mercurial 1764{ 1765 typeset child=$1 1766 typeset parent=$2 1767 1768 print " File list from: hg-active -p $parent ...\c" |
1770 | |
1771 if [[ ! -x $HG_ACTIVE ]]; then 1772 print # Blank line for the \c above 1773 print -u2 "Error: hg-active tool not found. Exiting" 1774 exit 1 1775 fi 1776 hg_active_wxfile $child $parent 1777 1778 # flist_from_wx prints the Done, so we don't have to. --- 502 unchanged lines hidden (view full) --- 2281 [[ -z $codemgr_ws ]] && codemgr_ws=$(workspace name) 2282 codemgr_ws=$(cd $codemgr_ws;print $PWD) 2283 CODEMGR_WS=$codemgr_ws 2284 CWS=$codemgr_ws 2285elif [[ $SCM_MODE == "mercurial" ]]; then 2286 # 2287 # Mercurial priorities: 2288 # 1. hg root from CODEMGR_WS environment variable | 1769 if [[ ! -x $HG_ACTIVE ]]; then 1770 print # Blank line for the \c above 1771 print -u2 "Error: hg-active tool not found. Exiting" 1772 exit 1 1773 fi 1774 hg_active_wxfile $child $parent 1775 1776 # flist_from_wx prints the Done, so we don't have to. --- 502 unchanged lines hidden (view full) --- 2279 [[ -z $codemgr_ws ]] && codemgr_ws=$(workspace name) 2280 codemgr_ws=$(cd $codemgr_ws;print $PWD) 2281 CODEMGR_WS=$codemgr_ws 2282 CWS=$codemgr_ws 2283elif [[ $SCM_MODE == "mercurial" ]]; then 2284 # 2285 # Mercurial priorities: 2286 # 1. hg root from CODEMGR_WS environment variable |
2287 # 1a. hg root from CODEMGR_WS/usr/closed if we're somewhere under 2288 # usr/closed when we run webrev |
|
2289 # 2. hg root from directory of invocation 2290 # | 2289 # 2. hg root from directory of invocation 2290 # |
2291 [[ -z $codemgr_ws && -n $CODEMGR_WS ]] && \ 2292 codemgr_ws=$(hg root -R $CODEMGR_WS 2>/dev/null) | 2291 if [[ ${PWD} =~ "usr/closed" ]]; then 2292 testparent=${CODEMGR_WS}/usr/closed 2293 # If we're in OpenSolaris mode, we enforce a minor policy: 2294 # help to make sure the reviewer doesn't accidentally publish 2295 # source which is under usr/closed 2296 if [[ -n "$Oflag" ]]; then 2297 print -u2 "OpenSolaris output not permitted with" \ 2298 "usr/closed changes" 2299 exit 1 2300 fi 2301 else 2302 testparent=${CODEMGR_WS} 2303 fi 2304 [[ -z $codemgr_ws && -n $testparent ]] && \ 2305 codemgr_ws=$(hg root -R $testparent 2>/dev/null) |
2293 [[ -z $codemgr_ws ]] && codemgr_ws=$(hg root 2>/dev/null) 2294 CWS=$codemgr_ws 2295elif [[ $SCM_MODE == "subversion" ]]; then 2296 # 2297 # Subversion priorities: 2298 # 1. CODEMGR_WS from environment 2299 # 2. Relative path from current directory to SVN repository root 2300 # --- 16 unchanged lines hidden (view full) --- 2317# 2318# If no SCM has been determined, take either the environment setting 2319# setting for CODEMGR_WS, or the current directory if that wasn't set. 2320# 2321if [[ -z ${CWS} ]]; then 2322 CWS=${CODEMGR_WS:-.} 2323fi 2324 | 2306 [[ -z $codemgr_ws ]] && codemgr_ws=$(hg root 2>/dev/null) 2307 CWS=$codemgr_ws 2308elif [[ $SCM_MODE == "subversion" ]]; then 2309 # 2310 # Subversion priorities: 2311 # 1. CODEMGR_WS from environment 2312 # 2. Relative path from current directory to SVN repository root 2313 # --- 16 unchanged lines hidden (view full) --- 2330# 2331# If no SCM has been determined, take either the environment setting 2332# setting for CODEMGR_WS, or the current directory if that wasn't set. 2333# 2334if [[ -z ${CWS} ]]; then 2335 CWS=${CODEMGR_WS:-.} 2336fi 2337 |
2325 2326 | |
2327# 2328# If the command line options indicate no webrev generation, either 2329# explicitly (-n) or implicitly (-D but not -U), then there's a whole 2330# ton of logic we can skip. 2331# 2332# Instead of increasing indentation, we intentionally leave this loop 2333# body open here, and exit via break from multiple points within. 2334# Search for DO_EVERYTHING below to find the break points and closure. --- 676 unchanged lines hidden (view full) --- 3011 COMM=`getcomments html $P $PP` 3012 3013 print "\t$P$oldname\n\t\t\c" 3014 3015 # Make the webrev mirror directory if necessary 3016 mkdir -p $WDIR/$DIR 3017 3018 # | 2338# 2339# If the command line options indicate no webrev generation, either 2340# explicitly (-n) or implicitly (-D but not -U), then there's a whole 2341# ton of logic we can skip. 2342# 2343# Instead of increasing indentation, we intentionally leave this loop 2344# body open here, and exit via break from multiple points within. 2345# Search for DO_EVERYTHING below to find the break points and closure. --- 676 unchanged lines hidden (view full) --- 3022 COMM=`getcomments html $P $PP` 3023 3024 print "\t$P$oldname\n\t\t\c" 3025 3026 # Make the webrev mirror directory if necessary 3027 mkdir -p $WDIR/$DIR 3028 3029 # |
3019 # If we're in OpenSolaris mode, we enforce a minor policy: 3020 # help to make sure the reviewer doesn't accidentally publish 3021 # source which is in usr/closed/* or deleted_files/usr/closed/* 3022 # 3023 if [[ -n "$Oflag" ]]; then 3024 pclosed=${P##usr/closed/} 3025 pdeleted=${P##deleted_files/usr/closed/} 3026 if [[ "$pclosed" != "$P" || "$pdeleted" != "$P" ]]; then 3027 print "*** Omitting closed source for OpenSolaris" \ 3028 "mode review" 3029 continue 3030 fi 3031 fi 3032 3033 # | |
3034 # We stash old and new files into parallel directories in $WDIR 3035 # and do our diffs there. This makes it possible to generate 3036 # clean looking diffs which don't have absolute paths present. 3037 # 3038 3039 build_old_new "$WDIR" "$PWS" "$PDIR" "$PF" "$CWS" "$DIR" "$F" || \ 3040 continue 3041 --- 473 unchanged lines hidden --- | 3030 # We stash old and new files into parallel directories in $WDIR 3031 # and do our diffs there. This makes it possible to generate 3032 # clean looking diffs which don't have absolute paths present. 3033 # 3034 3035 build_old_new "$WDIR" "$PWS" "$PDIR" "$PF" "$CWS" "$DIR" "$F" || \ 3036 continue 3037 --- 473 unchanged lines hidden --- |