Print this page
7436 webrev doesn't work if illumos-gate is a submodule
Reviewed by: Toomas Soome <tsoome@me.com>


  10 # or http://www.opensolaris.org/os/licensing.
  11 # See the License for the specific language governing permissions
  12 # and limitations under the License.
  13 #
  14 # When distributing Covered Code, include this CDDL HEADER in each
  15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  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 (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  25 # Copyright 2008, 2010, Richard Lowe
  26 # Copyright 2012 Marcel Telka <marcel@telka.sk>
  27 # Copyright 2014 Bart Coddens <bart.coddens@gmail.com>
  28 # Copyright 2016 Nexenta Systems, Inc.
  29 # Copyright 2016 Joyent, Inc.

  30 #
  31 
  32 #
  33 # This script takes a file list and a workspace and builds a set of html files
  34 # suitable for doing a code review of source changes via a web page.
  35 # Documentation is available via the manual page, webrev.1, or just
  36 # type 'webrev -h'.
  37 #
  38 # Acknowledgements to contributors to webrev are listed in the webrev(1)
  39 # man page.
  40 #
  41 
  42 REMOVED_COLOR=brown
  43 CHANGED_COLOR=blue
  44 NEW_COLOR=blue
  45 
  46 HTML='<?xml version="1.0"?>
  47 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  48     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  49 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n'


2345         [[ -z $codemgr_ws && -n $testparent ]] && \
2346             codemgr_ws=$(hg root -R $testparent 2>/dev/null)
2347         [[ -z $codemgr_ws ]] && codemgr_ws=$(hg root 2>/dev/null)
2348         CWS=$codemgr_ws
2349 elif [[ $SCM_MODE == "git" ]]; then
2350         #
2351         # Git priorities:
2352         # 1. git rev-parse --git-dir from CODEMGR_WS environment variable
2353         # 2. git rev-parse --git-dir from directory of invocation
2354         #
2355         [[ -z $codemgr_ws && -n $CODEMGR_WS ]] && \
2356             codemgr_ws=$($GIT --git-dir=$CODEMGR_WS/.git rev-parse --git-dir \
2357                 2>/dev/null)
2358         [[ -z $codemgr_ws ]] && \
2359             codemgr_ws=$($GIT rev-parse --git-dir 2>/dev/null)
2360 
2361         if [[ "$codemgr_ws" == ".git" ]]; then
2362                 codemgr_ws="${PWD}/${codemgr_ws}"
2363         fi
2364 

2365         codemgr_ws=$(dirname $codemgr_ws) # Lose the '/.git'

2366         CWS="$codemgr_ws"
2367 elif [[ $SCM_MODE == "subversion" ]]; then
2368         #
2369         # Subversion priorities:
2370         # 1. CODEMGR_WS from environment
2371         # 2. Relative path from current directory to SVN repository root
2372         #
2373         if [[ -n $CODEMGR_WS && -d $CODEMGR_WS/.svn ]]; then
2374                 CWS=$CODEMGR_WS
2375         else
2376                 svn info | while read line; do
2377                         if [[ $line == "URL: "* ]]; then
2378                                 url=${line#URL: }
2379                         elif [[ $line == "Repository Root: "* ]]; then
2380                                 repo=${line#Repository Root: }
2381                         fi
2382                 done
2383 
2384                 rel=${url#$repo}
2385                 CWS=${PWD%$rel}




  10 # or http://www.opensolaris.org/os/licensing.
  11 # See the License for the specific language governing permissions
  12 # and limitations under the License.
  13 #
  14 # When distributing Covered Code, include this CDDL HEADER in each
  15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  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 (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  25 # Copyright 2008, 2010, Richard Lowe
  26 # Copyright 2012 Marcel Telka <marcel@telka.sk>
  27 # Copyright 2014 Bart Coddens <bart.coddens@gmail.com>
  28 # Copyright 2016 Nexenta Systems, Inc.
  29 # Copyright 2016 Joyent, Inc.
  30 # Copyright 2016 RackTop Systems.
  31 #
  32 
  33 #
  34 # This script takes a file list and a workspace and builds a set of html files
  35 # suitable for doing a code review of source changes via a web page.
  36 # Documentation is available via the manual page, webrev.1, or just
  37 # type 'webrev -h'.
  38 #
  39 # Acknowledgements to contributors to webrev are listed in the webrev(1)
  40 # man page.
  41 #
  42 
  43 REMOVED_COLOR=brown
  44 CHANGED_COLOR=blue
  45 NEW_COLOR=blue
  46 
  47 HTML='<?xml version="1.0"?>
  48 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  49     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  50 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n'


2346         [[ -z $codemgr_ws && -n $testparent ]] && \
2347             codemgr_ws=$(hg root -R $testparent 2>/dev/null)
2348         [[ -z $codemgr_ws ]] && codemgr_ws=$(hg root 2>/dev/null)
2349         CWS=$codemgr_ws
2350 elif [[ $SCM_MODE == "git" ]]; then
2351         #
2352         # Git priorities:
2353         # 1. git rev-parse --git-dir from CODEMGR_WS environment variable
2354         # 2. git rev-parse --git-dir from directory of invocation
2355         #
2356         [[ -z $codemgr_ws && -n $CODEMGR_WS ]] && \
2357             codemgr_ws=$($GIT --git-dir=$CODEMGR_WS/.git rev-parse --git-dir \
2358                 2>/dev/null)
2359         [[ -z $codemgr_ws ]] && \
2360             codemgr_ws=$($GIT rev-parse --git-dir 2>/dev/null)
2361 
2362         if [[ "$codemgr_ws" == ".git" ]]; then
2363                 codemgr_ws="${PWD}/${codemgr_ws}"
2364         fi
2365 
2366         if [[ "$codemgr_ws" = *"/.git" ]]; then
2367                 codemgr_ws=$(dirname $codemgr_ws) # Lose the '/.git'
2368         fi
2369         CWS="$codemgr_ws"
2370 elif [[ $SCM_MODE == "subversion" ]]; then
2371         #
2372         # Subversion priorities:
2373         # 1. CODEMGR_WS from environment
2374         # 2. Relative path from current directory to SVN repository root
2375         #
2376         if [[ -n $CODEMGR_WS && -d $CODEMGR_WS/.svn ]]; then
2377                 CWS=$CODEMGR_WS
2378         else
2379                 svn info | while read line; do
2380                         if [[ $line == "URL: "* ]]; then
2381                                 url=${line#URL: }
2382                         elif [[ $line == "Repository Root: "* ]]; then
2383                                 repo=${line#Repository Root: }
2384                         fi
2385                 done
2386 
2387                 rel=${url#$repo}
2388                 CWS=${PWD%$rel}