Print this page
9001 cdm is useless, remove it
9002 webrev should know how to get the git user name
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Joshua M. Clulow <jmc@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/scripts/webrev.sh
          +++ new/usr/src/tools/scripts/webrev.sh
↓ open down ↓ 1561 lines elided ↑ open up ↑
1562 1562  }
1563 1563  
1564 1564  #
1565 1565  # comments_from_wx {text|html} filepath
1566 1566  #
1567 1567  # Given the pathname of a file, find its location in a "wx" active
1568 1568  # file list and print the following comment.  Output is either text or
1569 1569  # HTML; if the latter, embedded bugids (sequence of 5 or more digits)
1570 1570  # are turned into URLs.
1571 1571  #
1572      -# This is also used with Mercurial and the file list provided by hg-active.
1573      -#
1574 1572  comments_from_wx()
1575 1573  {
1576 1574          typeset fmt=$1
1577 1575          typeset p=$2
1578 1576  
1579 1577          comm=`$AWK '
1580 1578          $1 == "'$p'" {
1581 1579                  do getline ; while (NF > 0)
1582 1580                  getline
1583 1581                  while (NF > 0) { print ; getline }
↓ open down ↓ 20 lines elided ↑ open up ↑
1604 1602  #
1605 1603  getcomments()
1606 1604  {
1607 1605          typeset fmt=$1
1608 1606          typeset p=$2
1609 1607          typeset pp=$3
1610 1608  
1611 1609          if [[ -n $Nflag ]]; then
1612 1610                  return
1613 1611          fi
1614      -        #
1615      -        # Mercurial support uses a file list in wx format, so this
1616      -        # will be used there, too
1617      -        #
     1612 +
1618 1613          if [[ -n $wxfile ]]; then
1619 1614                  comments_from_wx $fmt $p
1620 1615          fi
1621 1616  }
1622 1617  
1623 1618  #
1624 1619  # printCI <total-changed> <inserted> <deleted> <modified> <unchanged>
1625 1620  #
1626 1621  # Print out Code Inspection figures similar to sccs-prt(1) format.
1627 1622  #
↓ open down ↓ 160 lines elided ↑ open up ↑
1788 1783            while (getline) {
1789 1784                  if (NF == 0) { c = -c; continue }
1790 1785                  if (c > 0) print
1791 1786            }
1792 1787          }' $wxfile > $FLIST
1793 1788  
1794 1789          print " Done."
1795 1790  }
1796 1791  
1797 1792  #
1798      -# Call hg-active to get the active list output in the wx active list format
1799      -#
1800      -function hg_active_wxfile
1801      -{
1802      -        typeset child=$1
1803      -        typeset parent=$2
1804      -
1805      -        TMPFLIST=/tmp/$$.active
1806      -        $HG_ACTIVE -w $child -p $parent -o $TMPFLIST
1807      -        wxfile=$TMPFLIST
1808      -}
1809      -
1810      -#
1811      -# flist_from_mercurial
1812      -# Call hg-active to get a wx-style active list, and hand it off to
1813      -# flist_from_wx
1814      -#
1815      -function flist_from_mercurial
1816      -{
1817      -        typeset child=$1
1818      -        typeset parent=$2
1819      -
1820      -        print " File list from: hg-active -p $parent ...\c"
1821      -        if [[ ! -x $HG_ACTIVE ]]; then
1822      -                print           # Blank line for the \c above
1823      -                print -u2 "Error: hg-active tool not found.  Exiting"
1824      -                exit 1
1825      -        fi
1826      -        hg_active_wxfile $child $parent
1827      -
1828      -        # flist_from_wx prints the Done, so we don't have to.
1829      -        flist_from_wx $TMPFLIST
1830      -}
1831      -
1832      -#
1833 1793  # Transform a specified 'git log' output format into a wx-like active list.
1834 1794  #
1835 1795  function git_wxfile
1836 1796  {
1837 1797          typeset child="$1"
1838 1798          typeset parent="$2"
1839 1799  
1840 1800          TMPFLIST=/tmp/$$.active
1841 1801          $PERL -e 'my (%files, %realfiles, $msg);
1842 1802          my $parent = $ARGV[0];
↓ open down ↓ 129 lines elided ↑ open up ↑
1972 1932                  if (@stat = stat($ARGV[0])) {
1973 1933                          $mode = $stat[2] & 0777;
1974 1934                          printf "%03o\n", $mode;
1975 1935                          exit 0;
1976 1936                  } else {
1977 1937                          exit 1;
1978 1938                  }
1979 1939              ' $1
1980 1940  }
1981 1941  
1982      -function build_old_new_mercurial
1983      -{
1984      -        typeset olddir="$1"
1985      -        typeset newdir="$2"
1986      -        typeset old_mode=
1987      -        typeset new_mode=
1988      -        typeset file
1989      -
1990      -        #
1991      -        # Get old file mode, from the parent revision manifest entry.
1992      -        # Mercurial only stores a "file is executable" flag, but the
1993      -        # manifest will display an octal mode "644" or "755".
1994      -        #
1995      -        if [[ "$PDIR" == "." ]]; then
1996      -                file="$PF"
1997      -        else
1998      -                file="$PDIR/$PF"
1999      -        fi
2000      -        file=`echo $file | $SED 's#/#\\\/#g'`
2001      -        # match the exact filename, and return only the permission digits
2002      -        old_mode=`$SED -n -e "/^\\(...\\) . ${file}$/s//\\1/p" \
2003      -            < $HG_PARENT_MANIFEST`
2004      -
2005      -        #
2006      -        # Get new file mode, directly from the filesystem.
2007      -        # Normalize the mode to match Mercurial's behavior.
2008      -        #
2009      -        new_mode=`get_file_mode $CWS/$DIR/$F`
2010      -        if [[ -n "$new_mode" ]]; then
2011      -                if [[ "$new_mode" = *[1357]* ]]; then
2012      -                        new_mode=755
2013      -                else
2014      -                        new_mode=644
2015      -                fi
2016      -        fi
2017      -
2018      -        #
2019      -        # new version of the file.
2020      -        #
2021      -        rm -rf $newdir/$DIR/$F
2022      -        if [[ -e $CWS/$DIR/$F ]]; then
2023      -                cp $CWS/$DIR/$F $newdir/$DIR/$F
2024      -                if [[ -n $new_mode ]]; then
2025      -                        chmod $new_mode $newdir/$DIR/$F
2026      -                else
2027      -                        # should never happen
2028      -                        print -u2 "ERROR: set mode of $newdir/$DIR/$F"
2029      -                fi
2030      -        fi
2031      -
2032      -        #
2033      -        # parent's version of the file
2034      -        #
2035      -        # Note that we get this from the last version common to both
2036      -        # ourselves and the parent.  References are via $CWS since we have no
2037      -        # guarantee that the parent workspace is reachable via the filesystem.
2038      -        #
2039      -        if [[ -n $parent_webrev && -e $PWS/$PDIR/$PF ]]; then
2040      -                cp $PWS/$PDIR/$PF $olddir/$PDIR/$PF
2041      -        elif [[ -n $HG_PARENT ]]; then
2042      -                hg cat -R $CWS -r $HG_PARENT $CWS/$PDIR/$PF > \
2043      -                    $olddir/$PDIR/$PF 2>/dev/null
2044      -
2045      -                if (( $? != 0 )); then
2046      -                        rm -f $olddir/$PDIR/$PF
2047      -                else
2048      -                        if [[ -n $old_mode ]]; then
2049      -                                chmod $old_mode $olddir/$PDIR/$PF
2050      -                        else
2051      -                                # should never happen
2052      -                                print -u2 "ERROR: set mode of $olddir/$PDIR/$PF"
2053      -                        fi
2054      -                fi
2055      -        fi
2056      -}
2057      -
2058 1942  function build_old_new_git
2059 1943  {
2060 1944          typeset olddir="$1"
2061 1945          typeset newdir="$2"
2062 1946          typeset o_mode=
2063 1947          typeset n_mode=
2064 1948          typeset o_object=
2065 1949          typeset n_object=
2066 1950          typeset OWD=$PWD
2067 1951          typeset file
↓ open down ↓ 94 lines elided ↑ open up ↑
2162 2046          typeset CWS=$5
2163 2047          typeset DIR=$6
2164 2048          typeset F=$7
2165 2049  
2166 2050          typeset olddir="$WDIR/raw_files/old"
2167 2051          typeset newdir="$WDIR/raw_files/new"
2168 2052  
2169 2053          mkdir -p $olddir/$PDIR
2170 2054          mkdir -p $newdir/$DIR
2171 2055  
2172      -        if [[ $SCM_MODE == "mercurial" ]]; then
2173      -                build_old_new_mercurial "$olddir" "$newdir"
2174      -        elif [[ $SCM_MODE == "git" ]]; then
     2056 +        if [[ $SCM_MODE == "git" ]]; then
2175 2057                  build_old_new_git "$olddir" "$newdir"
2176 2058          elif [[ $SCM_MODE == "subversion" ]]; then
2177 2059                  build_old_new_subversion "$olddir" "$newdir"
2178 2060          elif [[ $SCM_MODE == "unknown" ]]; then
2179 2061                  build_old_new_unknown "$olddir" "$newdir"
2180 2062          fi
2181 2063  
2182 2064          if [[ ! -f $olddir/$PDIR/$PF && ! -f $newdir/$DIR/$F ]]; then
2183 2065                  print "*** Error: file not in parent or child"
2184 2066                  return 1
↓ open down ↓ 45 lines elided ↑ open up ↑
2230 2112  #
2231 2113  
2232 2114  trap "rm -f /tmp/$$.* ; exit" 0 1 2 3 15
2233 2115  
2234 2116  set +o noclobber
2235 2117  
2236 2118  PATH=$(/bin/dirname "$(whence $0)"):$PATH
2237 2119  
2238 2120  [[ -z $WDIFF ]] && WDIFF=`look_for_prog wdiff`
2239 2121  [[ -z $WX ]] && WX=`look_for_prog wx`
2240      -[[ -z $HG_ACTIVE ]] && HG_ACTIVE=`look_for_prog hg-active`
2241 2122  [[ -z $GIT ]] && GIT=`look_for_prog git`
2242 2123  [[ -z $WHICH_SCM ]] && WHICH_SCM=`look_for_prog which_scm`
2243 2124  [[ -z $CODEREVIEW ]] && CODEREVIEW=`look_for_prog codereview`
2244 2125  [[ -z $PS2PDF ]] && PS2PDF=`look_for_prog ps2pdf`
2245 2126  [[ -z $PERL ]] && PERL=`look_for_prog perl`
2246 2127  [[ -z $RSYNC ]] && RSYNC=`look_for_prog rsync`
2247 2128  [[ -z $SCCS ]] && SCCS=`look_for_prog sccs`
2248 2129  [[ -z $AWK ]] && AWK=`look_for_prog nawk`
2249 2130  [[ -z $AWK ]] && AWK=`look_for_prog gawk`
2250 2131  [[ -z $AWK ]] && AWK=`look_for_prog awk`
↓ open down ↓ 52 lines elided ↑ open up ↑
2303 2184  nflag=
2304 2185  Oflag=
2305 2186  oflag=
2306 2187  pflag=
2307 2188  tflag=
2308 2189  uflag=
2309 2190  Uflag=
2310 2191  wflag=
2311 2192  remote_target=
2312 2193  
2313      -#
2314      -# NOTE: when adding/removing options it is necessary to sync the list
2315      -#       with usr/src/tools/onbld/hgext/cdm.py
2316      -#
2317 2194  while getopts "c:C:Dh:i:I:lnNo:Op:t:Uw" opt
2318 2195  do
2319 2196          case $opt in
2320 2197          c)      cflag=1
2321 2198                  codemgr_head=$OPTARG
2322 2199                  codemgr_parent=$OPTARG~1;;
2323 2200  
2324 2201          C)      Cflag=1
2325 2202                  ITSCONF=$OPTARG;;
2326 2203  
↓ open down ↓ 50 lines elided ↑ open up ↑
2377 2254          exit 1
2378 2255  fi
2379 2256  
2380 2257  #
2381 2258  # For the invocation "webrev -n -U" with no other options, webrev will assume
2382 2259  # that the webrev exists in ${CWS}/webrev, but will upload it using the name
2383 2260  # $(basename ${CWS}).  So we need to get CWS set before we skip any remaining
2384 2261  # logic.
2385 2262  #
2386 2263  $WHICH_SCM | read SCM_MODE junk || exit 1
2387      -if [[ $SCM_MODE == "mercurial" ]]; then
2388      -        #
2389      -        # Mercurial priorities:
2390      -        # 1. hg root from CODEMGR_WS environment variable
2391      -        # 1a. hg root from CODEMGR_WS/usr/closed if we're somewhere under
2392      -        #    usr/closed when we run webrev
2393      -        # 2. hg root from directory of invocation
2394      -        #
2395      -        if [[ ${PWD} =~ "usr/closed" ]]; then
2396      -                testparent=${CODEMGR_WS}/usr/closed
2397      -                # If we're in OpenSolaris mode, we enforce a minor policy:
2398      -                # help to make sure the reviewer doesn't accidentally publish
2399      -                # source which is under usr/closed
2400      -                if [[ -n "$Oflag" ]]; then
2401      -                        print -u2 "OpenSolaris output not permitted with" \
2402      -                            "usr/closed changes"
2403      -                        exit 1
2404      -                fi
2405      -        else
2406      -                testparent=${CODEMGR_WS}
2407      -        fi
2408      -        [[ -z $codemgr_ws && -n $testparent ]] && \
2409      -            codemgr_ws=$(hg root -R $testparent 2>/dev/null)
2410      -        [[ -z $codemgr_ws ]] && codemgr_ws=$(hg root 2>/dev/null)
2411      -        CWS=$codemgr_ws
2412      -elif [[ $SCM_MODE == "git" ]]; then
     2264 +
     2265 +if [[ $SCM_MODE == "git" ]]; then
2413 2266          #
2414 2267          # Git priorities:
2415 2268          # 1. git rev-parse --git-dir from CODEMGR_WS environment variable
2416 2269          # 2. git rev-parse --git-dir from directory of invocation
2417 2270          #
2418 2271          [[ -z $codemgr_ws && -n $CODEMGR_WS ]] && \
2419 2272              codemgr_ws=$($GIT --git-dir=$CODEMGR_WS/.git rev-parse --git-dir \
2420 2273                  2>/dev/null)
2421 2274          [[ -z $codemgr_ws ]] && \
2422 2275              codemgr_ws=$($GIT rev-parse --git-dir 2>/dev/null)
↓ open down ↓ 82 lines elided ↑ open up ↑
2505 2358          else
2506 2359                  flist_mode="auto"
2507 2360          fi
2508 2361  fi
2509 2362  
2510 2363  #
2511 2364  # Before we go on to further consider -l and -w, work out which SCM we think
2512 2365  # is in use.
2513 2366  #
2514 2367  case "$SCM_MODE" in
2515      -mercurial|git|subversion)
     2368 +git|subversion)
2516 2369          ;;
2517 2370  unknown)
2518 2371          if [[ $flist_mode == "auto" ]]; then
2519 2372                  print -u2 "Unable to determine SCM in use and file list not specified"
2520 2373                  print -u2 "See which_scm(1) for SCM detection information."
2521 2374                  exit 1
2522 2375          fi
2523 2376          ;;
2524 2377  *)
2525 2378          if [[ $flist_mode == "auto" ]]; then
↓ open down ↓ 37 lines elided ↑ open up ↑
2563 2416  elif [[ $flist_mode == "stdin" ]]; then
2564 2417          print -u2 " File list from: standard input"
2565 2418  elif [[ $flist_mode == "file" ]]; then
2566 2419          print -u2 " File list from: $flist_file"
2567 2420  fi
2568 2421  
2569 2422  if [[ $# -gt 0 ]]; then
2570 2423          print -u2 "WARNING: unused arguments: $*"
2571 2424  fi
2572 2425  
2573      -#
2574      -# Before we entered the DO_EVERYTHING loop, we should have already set CWS
2575      -# and CODEMGR_WS as needed.  Here, we set the parent workspace.
2576      -#
2577      -if [[ $SCM_MODE == "mercurial" ]]; then
2578      -        #
2579      -        # Parent can either be specified with -p
2580      -        # Specified with CODEMGR_PARENT in the environment
2581      -        # or taken from hg's default path.
2582      -        #
2583      -
2584      -        if [[ -z $codemgr_parent && -n $CODEMGR_PARENT ]]; then
2585      -                codemgr_parent=$CODEMGR_PARENT
2586      -        fi
2587      -
2588      -        if [[ -z $codemgr_parent ]]; then
2589      -                codemgr_parent=`hg path -R $codemgr_ws default 2>/dev/null`
2590      -        fi
2591      -
2592      -        PWS=$codemgr_parent
2593      -
2594      -        #
2595      -        # If the parent is a webrev, we want to do some things against
2596      -        # the natural workspace parent (file list, comments, etc)
2597      -        #
2598      -        if [[ -n $parent_webrev ]]; then
2599      -                real_parent=$(hg path -R $codemgr_ws default 2>/dev/null)
2600      -        else
2601      -                real_parent=$PWS
2602      -        fi
2603      -
2604      -        #
2605      -        # If hg-active exists, then we run it.  In the case of no explicit
2606      -        # flist given, we'll use it for our comments.  In the case of an
2607      -        # explicit flist given we'll try to use it for comments for any
2608      -        # files mentioned in the flist.
2609      -        #
2610      -        if [[ -z $flist_done ]]; then
2611      -                flist_from_mercurial $CWS $real_parent
2612      -                flist_done=1
2613      -        fi
2614      -
2615      -        #
2616      -        # If we have a file list now, pull out any variables set
2617      -        # therein.  We do this now (rather than when we possibly use
2618      -        # hg-active to find comments) to avoid stomping specifications
2619      -        # in the user-specified flist.
2620      -        #
2621      -        if [[ -n $flist_done ]]; then
2622      -                env_from_flist
2623      -        fi
2624      -
2625      -        #
2626      -        # Only call hg-active if we don't have a wx formatted file already
2627      -        #
2628      -        if [[ -x $HG_ACTIVE && -z $wxfile ]]; then
2629      -                print "  Comments from: hg-active -p $real_parent ...\c"
2630      -                hg_active_wxfile $CWS $real_parent
2631      -                print " Done."
2632      -        fi
2633 2426  
2634      -        #
2635      -        # At this point we must have a wx flist either from hg-active,
2636      -        # or in general.  Use it to try and find our parent revision,
2637      -        # if we don't have one.
2638      -        #
2639      -        if [[ -z $HG_PARENT ]]; then
2640      -                eval `$SED -e "s/#.*$//" $wxfile | $GREP HG_PARENT=`
2641      -        fi
2642      -
2643      -        #
2644      -        # If we still don't have a parent, we must have been given a
2645      -        # wx-style active list with no HG_PARENT specification, run
2646      -        # hg-active and pull an HG_PARENT out of it, ignore the rest.
2647      -        #
2648      -        if [[ -z $HG_PARENT && -x $HG_ACTIVE ]]; then
2649      -                $HG_ACTIVE -w $codemgr_ws -p $real_parent | \
2650      -                    eval `$SED -e "s/#.*$//" | $GREP HG_PARENT=`
2651      -        elif [[ -z $HG_PARENT ]]; then
2652      -                print -u2 "Error: Cannot discover parent revision"
2653      -                exit 1
2654      -        fi
2655      -
2656      -        pnode=$(trim_digest $HG_PARENT)
2657      -        PRETTY_PWS="${PWS} (at ${pnode})"
2658      -        cnode=$(hg parent -R $codemgr_ws --template '{node|short}' \
2659      -            2>/dev/null)
2660      -        PRETTY_CWS="${CWS} (at ${cnode})"}
2661      -elif [[ $SCM_MODE == "git" ]]; then
     2427 +if [[ $SCM_MODE == "git" ]]; then
2662 2428          # Check that "head" revision specified with -c or -h is sane
2663 2429          if [[ -n $cflag || -n $hflag ]]; then
2664 2430                  head_rev=$($GIT rev-parse --verify --quiet "$codemgr_head")
2665 2431                  if [[ -z $head_rev ]]; then
2666 2432                          print -u2 "Error: bad revision ${codemgr_head}"
2667 2433                          exit 1
2668 2434                  fi
2669 2435          fi
2670 2436  
2671 2437          if [[ -z $codemgr_head ]]; then
↓ open down ↓ 396 lines elided ↑ open up ↑
3068 2834  
3069 2835  print "   Output Files:"
3070 2836  
3071 2837  #
3072 2838  # Clean up the file list: Remove comments, blank lines and env variables.
3073 2839  #
3074 2840  $SED -e "s/#.*$//" -e "/=/d" -e "/^[   ]*$/d" $FLIST > /tmp/$$.flist.clean
3075 2841  FLIST=/tmp/$$.flist.clean
3076 2842  
3077 2843  #
3078      -# For Mercurial, create a cache of manifest entries.
3079      -#
3080      -if [[ $SCM_MODE == "mercurial" ]]; then
3081      -        #
3082      -        # Transform the FLIST into a temporary sed script that matches
3083      -        # relevant entries in the Mercurial manifest as follows:
3084      -        # 1) The script will be used against the parent revision manifest,
3085      -        #    so for FLIST lines that have two filenames (a renamed file)
3086      -        #    keep only the old name.
3087      -        # 2) Escape all forward slashes the filename.
3088      -        # 3) Change the filename into another sed command that matches
3089      -        #    that file in "hg manifest -v" output:  start of line, three
3090      -        #    octal digits for file permissions, space, a file type flag
3091      -        #    character, space, the filename, end of line.
3092      -        # 4) Eliminate any duplicate entries.  (This can occur if a
3093      -        #    file has been used as the source of an hg cp and it's
3094      -        #    also been modified in the same changeset.)
3095      -        #
3096      -        SEDFILE=/tmp/$$.manifest.sed
3097      -        $SED '
3098      -                s#^[^ ]* ##
3099      -                s#/#\\\/#g
3100      -                s#^.*$#/^... . &$/p#
3101      -        ' < $FLIST | $SORT -u > $SEDFILE
3102      -
3103      -        #
3104      -        # Apply the generated script to the output of "hg manifest -v"
3105      -        # to get the relevant subset for this webrev.
3106      -        #
3107      -        HG_PARENT_MANIFEST=/tmp/$$.manifest
3108      -        hg -R $CWS manifest -v -r $HG_PARENT |
3109      -            $SED -n -f $SEDFILE > $HG_PARENT_MANIFEST
3110      -fi
3111      -
3112      -#
3113 2844  # First pass through the files: generate the per-file webrev HTML-files.
3114 2845  #
3115 2846  cat $FLIST | while read LINE
3116 2847  do
3117 2848          set - $LINE
3118 2849          P=$1
3119 2850  
3120 2851          #
3121 2852          # Normally, each line in the file list is just a pathname of a
3122 2853          # file that has been modified or created in the child.  A file
↓ open down ↓ 293 lines elided ↑ open up ↑
3416 3147  print "</head>"
3417 3148  print "<body id=\"SUNWwebrev\">"
3418 3149  print "<div class=\"summary\">"
3419 3150  print "<h2>Code Review for $WNAME</h2>"
3420 3151  
3421 3152  print "<table>"
3422 3153  
3423 3154  #
3424 3155  # Get the preparer's name:
3425 3156  #
3426      -# If the SCM detected is Mercurial, and the configuration property
3427      -# ui.username is available, use that, but be careful to properly escape
3428      -# angle brackets (HTML syntax characters) in the email address.
     3157 +# If the SCM detected is Git, and the configuration property user.name is
     3158 +# available, use that, but be careful to properly escape angle brackets (HTML
     3159 +# syntax characters) in the email address.
3429 3160  #
3430 3161  # Otherwise, use the current userid in the form "John Doe (jdoe)", but
3431 3162  # to maintain compatibility with passwd(4), we must support '&' substitutions.
3432 3163  #
3433 3164  preparer=
3434      -if [[ "$SCM_MODE" == mercurial ]]; then
3435      -        preparer=`hg showconfig ui.username 2>/dev/null`
     3165 +if [[ "$SCM_MODE" == git ]]; then
     3166 +        preparer=$(git config user.name 2>/dev/null)
3436 3167          if [[ -n "$preparer" ]]; then
3437 3168                  preparer="$(echo "$preparer" | html_quote)"
3438 3169          fi
3439 3170  fi
3440 3171  if [[ -z "$preparer" ]]; then
3441 3172          preparer=$(
3442 3173              $PERL -e '
3443 3174                  ($login, $pw, $uid, $gid, $quota, $cmt, $gcos) = getpwuid($<);
3444 3175                  if ($login) {
3445 3176                      $gcos =~ s/\&/ucfirst($login)/e;
↓ open down ↓ 207 lines elided ↑ open up ↑
3653 3384  
3654 3385          # Add additional comments comment
3655 3386          print "<!-- Add comments to explain changes in $P here -->"
3656 3387  
3657 3388          # Add count of changes.
3658 3389          if [[ -f $F.count ]]; then
3659 3390              cat $F.count
3660 3391              rm $F.count
3661 3392          fi
3662 3393  
3663      -        if [[ $SCM_MODE == "mercurial" ||
3664      -            $SCM_MODE == "unknown" ]]; then
     3394 +        if [[ $SCM_MODE == "unknown" ]]; then
3665 3395                  # Include warnings for important file mode situations:
3666 3396                  # 1) New executable files
3667 3397                  # 2) Permission changes of any kind
3668 3398                  # 3) Existing executable files
3669 3399                  old_mode=
3670 3400                  if [[ -f $WDIR/raw_files/old/$PP ]]; then
3671 3401                          old_mode=`get_file_mode $WDIR/raw_files/old/$PP`
3672 3402                  fi
3673 3403  
3674 3404                  new_mode=
↓ open down ↓ 52 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX