changeset 887:1378ccca1c79

Merge
author jlaskey
date Tue, 09 Apr 2013 08:35:31 -0300
parents 11c057460b91 (diff) fe5a388bf8fe (current diff)
children 8a7e97848471
files common/autoconf/generated-configure.sh common/autoconf/spec.gmk.in common/bin/hgforest.sh common/makefiles/Main.gmk
diffstat 10 files changed, 257 insertions(+), 84 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Tue Mar 26 09:13:00 2013 -0300
+++ b/.hgtags	Tue Apr 09 08:35:31 2013 -0300
@@ -203,3 +203,6 @@
 91d35211e74464dca5edf9b66ab01d0d0d8cded7 jdk8-b79
 907a926d3c96472f357617b48b6b968ea855c23c jdk8-b80
 145dbc56f931c134e837b675b9e6e7bf08902e93 jdk8-b81
+29153d0df68f84162ffe8c2cf4f402a3f2245e85 jdk8-b82
+466685ba01bfb7bc1e1ac61490fd8c0f3cc18763 jdk8-b83
+01f631f89fa392b4e484d0812c40ea8f9d2353aa jdk8-b84
--- a/common/autoconf/autogen.sh	Tue Mar 26 09:13:00 2013 -0300
+++ b/common/autoconf/autogen.sh	Tue Apr 09 08:35:31 2013 -0300
@@ -43,14 +43,24 @@
 
 custom_hook=$custom_script_dir/custom-hook.m4
 
-if test "x`which autoconf 2> /dev/null`" = x; then
+AUTOCONF=$(which autoconf 2> /dev/null);
+AUTOCONF_267=$(which autoconf-2.67 2> /dev/null);
+
+echo "Autoconf found: ${AUTOCONF}"
+echo "Autoconf-2.67 found: ${AUTOCONF_267}"
+
+if test "x${AUTOCONF}" = x; then
   echo You need autoconf installed to be able to regenerate the configure script
   echo Error: Cannot find autoconf 1>&2
   exit 1
 fi
 
-echo Generating generated-configure.sh
-cat $script_dir/configure.ac  | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | autoconf -W all -I$script_dir - > $script_dir/generated-configure.sh
+if test "x${AUTOCONF_267}" != x; then
+  AUTOCONF=${AUTOCONF_267};
+fi
+
+echo Generating generated-configure.sh with ${AUTOCONF}
+cat $script_dir/configure.ac  | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | ${AUTOCONF} -W all -I$script_dir - > $script_dir/generated-configure.sh
 rm -rf autom4te.cache
 
 if test -e $custom_hook; then
@@ -58,7 +68,7 @@
   # We have custom sources available; also generate configure script
   # with custom hooks compiled in.
   cat $script_dir/configure.ac | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | \
-    sed -e "s|#CUSTOM_AUTOCONF_INCLUDE|m4_include([$custom_hook])|" | autoconf -W all -I$script_dir - > $custom_script_dir/generated-configure.sh
+    sed -e "s|#CUSTOM_AUTOCONF_INCLUDE|m4_include([$custom_hook])|" | ${AUTOCONF} -W all -I$script_dir - > $custom_script_dir/generated-configure.sh
   rm -rf autom4te.cache
 else
   echo No custom hook found:  $custom_hook
--- a/common/autoconf/configure.ac	Tue Mar 26 09:13:00 2013 -0300
+++ b/common/autoconf/configure.ac	Tue Apr 09 08:35:31 2013 -0300
@@ -194,6 +194,7 @@
 ###############################################################################
 
 JDKOPT_SETUP_BUILD_TWEAKS
+JDKOPT_DETECT_INTREE_EC
 
 ###############################################################################
 #
--- a/common/autoconf/generated-configure.sh	Tue Mar 26 09:13:00 2013 -0300
+++ b/common/autoconf/generated-configure.sh	Tue Apr 09 08:35:31 2013 -0300
@@ -612,6 +612,7 @@
 JOBS
 MEMORY_SIZE
 NUM_CORES
+ENABLE_INTREE_EC
 SALIB_NAME
 HOTSPOT_MAKE_ARGS
 FIXPATH
@@ -1012,6 +1013,7 @@
 with_alsa
 with_alsa_include
 with_alsa_lib
+with_giflib
 with_zlib
 with_stdc__lib
 with_num_cores
@@ -1770,6 +1772,8 @@
                           headers under PATH/include)
   --with-alsa-include     specify directory for the alsa include files
   --with-alsa-lib         specify directory for the alsa library
+  --with-giflib           use giflib from build system or OpenJDK source
+                          (system, bundled) [bundled]
   --with-zlib             use zlib from build system or OpenJDK source
                           (system, bundled) [bundled]
   --with-stdc++lib=<static>,<dynamic>,<default>
@@ -3752,7 +3756,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1363150186
+DATE_WHEN_GENERATED=1364922883
 
 ###############################################################################
 #
@@ -10786,6 +10790,12 @@
 
 ###############################################################################
 #
+# Enable or disable the elliptic curve crypto implementation
+#
+
+
+###############################################################################
+#
 # Compress jars
 #
 COMPRESS_JARS=false
@@ -28896,14 +28906,15 @@
 #
 # ZIP_DEBUGINFO_FILES
 #
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should zip debug-info files" >&5
+$as_echo_n "checking if we should zip debug-info files... " >&6; }
 # Check whether --enable-zip-debug-info was given.
 if test "${enable_zip_debug_info+set}" = set; then :
-  enableval=$enable_zip_debug_info;
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should zip debug-info files" >&5
-$as_echo_n "checking if we should zip debug-info files... " >&6; }
+  enableval=$enable_zip_debug_info; enable_zip_debug_info="${enableval}"
+else
+  enable_zip_debug_info="yes"
+fi
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${enable_zip_debug_info}" >&5
 $as_echo "${enable_zip_debug_info}" >&6; }
 
@@ -29823,7 +29834,7 @@
 _ACEOF
  X11_A_OK=yes
 else
-  X11_A_OK=no
+  X11_A_OK=no; break
 fi
 
 done
@@ -31171,10 +31182,44 @@
 # Check for the gif library
 #
 
-USE_EXTERNAL_LIBJPEG=true
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lgif" >&5
-$as_echo_n "checking for main in -lgif... " >&6; }
-if ${ac_cv_lib_gif_main+:} false; then :
+
+# Check whether --with-giflib was given.
+if test "${with_giflib+set}" = set; then :
+  withval=$with_giflib;
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for which giflib to use" >&5
+$as_echo_n "checking for which giflib to use... " >&6; }
+
+# default is bundled
+DEFAULT_GIFLIB=bundled
+
+#
+# if user didn't specify, use DEFAULT_GIFLIB
+#
+if test "x${with_giflib}" = "x"; then
+    with_giflib=${DEFAULT_GIFLIB}
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_giflib}" >&5
+$as_echo "${with_giflib}" >&6; }
+
+if test "x${with_giflib}" = "xbundled"; then
+    USE_EXTERNAL_LIBGIF=false
+elif test "x${with_giflib}" = "xsystem"; then
+    ac_fn_cxx_check_header_mongrel "$LINENO" "gif_lib.h" "ac_cv_header_gif_lib_h" "$ac_includes_default"
+if test "x$ac_cv_header_gif_lib_h" = xyes; then :
+
+else
+   as_fn_error $? "--with-giflib=system specified, but gif_lib.h not found!" "$LINENO" 5
+fi
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DGifGetCode in -lgif" >&5
+$as_echo_n "checking for DGifGetCode in -lgif... " >&6; }
+if ${ac_cv_lib_gif_DGifGetCode+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -31182,27 +31227,33 @@
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-
-int
-main ()
-{
-return main ();
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char DGifGetCode ();
+int
+main ()
+{
+return DGifGetCode ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_cxx_try_link "$LINENO"; then :
-  ac_cv_lib_gif_main=yes
-else
-  ac_cv_lib_gif_main=no
+  ac_cv_lib_gif_DGifGetCode=yes
+else
+  ac_cv_lib_gif_DGifGetCode=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_main" >&5
-$as_echo "$ac_cv_lib_gif_main" >&6; }
-if test "x$ac_cv_lib_gif_main" = xyes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_DGifGetCode" >&5
+$as_echo "$ac_cv_lib_gif_DGifGetCode" >&6; }
+if test "x$ac_cv_lib_gif_DGifGetCode" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBGIF 1
 _ACEOF
@@ -31210,12 +31261,14 @@
   LIBS="-lgif $LIBS"
 
 else
-   USE_EXTERNAL_LIBGIF=false
-               { $as_echo "$as_me:${as_lineno-$LINENO}: Will use gif decoder bundled with the OpenJDK source" >&5
-$as_echo "$as_me: Will use gif decoder bundled with the OpenJDK source" >&6;}
-
-fi
-
+   as_fn_error $? "--with-giflib=system specified, but no giflib found!" "$LINENO" 5
+fi
+
+
+    USE_EXTERNAL_LIBGIF=true
+else
+    as_fn_error $? "Invalid value of --with-giflib: ${with_giflib}, use 'system' or 'bundled'" "$LINENO" 5
+fi
 
 
 ###############################################################################
@@ -31694,6 +31747,22 @@
 
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if elliptic curve crypto implementation is present" >&5
+$as_echo_n "checking if elliptic curve crypto implementation is present... " >&6; }
+
+if test -d "${SRC_ROOT}/jdk/src/share/native/sun/security/ec/impl"; then
+    ENABLE_INTREE_EC=yes
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+    ENABLE_INTREE_EC=no
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
 ###############################################################################
 #
 # Configure parts of the build that only affect the build performance,
--- a/common/autoconf/jdk-options.m4	Tue Mar 26 09:13:00 2013 -0300
+++ b/common/autoconf/jdk-options.m4	Tue Apr 09 08:35:31 2013 -0300
@@ -366,6 +366,25 @@
 
 ###############################################################################
 #
+# Enable or disable the elliptic curve crypto implementation
+#
+AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC],
+[
+AC_MSG_CHECKING([if elliptic curve crypto implementation is present])
+
+if test -d "${SRC_ROOT}/jdk/src/share/native/sun/security/ec/impl"; then
+    ENABLE_INTREE_EC=yes
+    AC_MSG_RESULT([yes])
+else
+    ENABLE_INTREE_EC=no
+    AC_MSG_RESULT([no])
+fi
+
+AC_SUBST(ENABLE_INTREE_EC)
+])
+
+###############################################################################
+#
 # Compress jars
 #
 COMPRESS_JARS=false
@@ -500,10 +519,10 @@
 #
 # ZIP_DEBUGINFO_FILES
 #
+AC_MSG_CHECKING([if we should zip debug-info files])
 AC_ARG_ENABLE([zip-debug-info],
-              [AS_HELP_STRING([--disable-zip-debug-info],[disable zipping of debug-info files @<:@enabled@:>@])])
-
-AC_MSG_CHECKING([if we should zip debug-info files])
+              [AS_HELP_STRING([--disable-zip-debug-info],[disable zipping of debug-info files @<:@enabled@:>@])],
+	      [enable_zip_debug_info="${enableval}"], [enable_zip_debug_info="yes"])
 AC_MSG_RESULT([${enable_zip_debug_info}])
 
 if test "x${enable_zip_debug_info}" = "xno"; then
--- a/common/autoconf/libraries.m4	Tue Mar 26 09:13:00 2013 -0300
+++ b/common/autoconf/libraries.m4	Tue Apr 09 08:35:31 2013 -0300
@@ -182,7 +182,7 @@
 # Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10
 AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h],
                  [X11_A_OK=yes],
-                 [X11_A_OK=no],
+                 [X11_A_OK=no; break],
                  [ # include <X11/Xlib.h>
                    # include <X11/Xutil.h>
                  ])
@@ -499,11 +499,36 @@
 # Check for the gif library
 #
 
-USE_EXTERNAL_LIBJPEG=true
-AC_CHECK_LIB(gif, main, [],
-             [ USE_EXTERNAL_LIBGIF=false
-               AC_MSG_NOTICE([Will use gif decoder bundled with the OpenJDK source])
-             ])
+AC_ARG_WITH(giflib, [AS_HELP_STRING([--with-giflib],
+	[use giflib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
+
+
+AC_MSG_CHECKING([for which giflib to use])
+
+# default is bundled
+DEFAULT_GIFLIB=bundled
+
+#
+# if user didn't specify, use DEFAULT_GIFLIB
+#
+if test "x${with_giflib}" = "x"; then
+    with_giflib=${DEFAULT_GIFLIB}
+fi
+
+AC_MSG_RESULT(${with_giflib})
+
+if test "x${with_giflib}" = "xbundled"; then
+    USE_EXTERNAL_LIBGIF=false
+elif test "x${with_giflib}" = "xsystem"; then
+    AC_CHECK_HEADER(gif_lib.h, [],
+             [ AC_MSG_ERROR([--with-giflib=system specified, but gif_lib.h not found!])])
+    AC_CHECK_LIB(gif, DGifGetCode, [],
+             [ AC_MSG_ERROR([--with-giflib=system specified, but no giflib found!])])
+
+    USE_EXTERNAL_LIBGIF=true
+else
+    AC_MSG_ERROR([Invalid value of --with-giflib: ${with_giflib}, use 'system' or 'bundled'])
+fi
 AC_SUBST(USE_EXTERNAL_LIBGIF)
 
 ###############################################################################
--- a/common/autoconf/spec.gmk.in	Tue Mar 26 09:13:00 2013 -0300
+++ b/common/autoconf/spec.gmk.in	Tue Apr 09 08:35:31 2013 -0300
@@ -539,6 +539,7 @@
 
 # Build setup
 ENABLE_JFR=@ENABLE_JFR@
+ENABLE_INTREE_EC=@ENABLE_INTREE_EC@
 USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@
 USE_EXTERNAL_LIBGIF:=@USE_EXTERNAL_LIBGIF@
 USE_EXTERNAL_LIBZ:=@USE_EXTERNAL_LIBZ@
--- a/common/bin/hgforest.sh	Tue Mar 26 09:13:00 2013 -0300
+++ b/common/bin/hgforest.sh	Tue Apr 09 08:35:31 2013 -0300
@@ -30,7 +30,7 @@
 # Python always buffers stdout significantly, thus we will not see any output from hg clone jdk,
 # until a lot of time has passed! By passing -u to python, we get incremental updates
 # on stdout. Much nicer.
-whichhg="`which hg`"
+whichhg="`which hg 2> /dev/null | grep -v '^no hg in'`"
 
 if [ "${whichhg}" = "" ] ; then
   echo Cannot find hg!
@@ -51,7 +51,7 @@
    bpython="`basename "$python"`"
 fi
 
-if [ "python" = "$bpython" -a -x "$python" ] ; then
+if [ -x "$python" -a ! -d "$python" -a "`${python} -V 2>&1 | cut -f 1 -d ' '`" = "Python" ] ; then
   hg="${python} -u ${whichhg}"
 else
   echo Cannot find python from hg launcher. Running plain hg, which probably has buffered stdout.
--- a/common/makefiles/Main.gmk	Tue Mar 26 09:13:00 2013 -0300
+++ b/common/makefiles/Main.gmk	Tue Apr 09 08:35:31 2013 -0300
@@ -197,7 +197,7 @@
 
 
 # Remove everything, except the output from configure.
-clean: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-nashorn clean-images clean-overlay-images clean-bootcycle-build clean-docs
+clean: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-nashorn clean-images clean-overlay-images clean-bootcycle-build clean-docs clean-test
 	@($(CD) $(OUTPUT_ROOT) && $(RM) -r tmp source_tips build.log* build-trace*.log*)
 	@$(ECHO) Cleaned all build artifacts.
 
@@ -238,6 +238,8 @@
 clean-docs:
 	$(call CleanComponent,docs)
 	$(call CleanComponent,docstemp)
+clean-test:
+	$(call CleanComponent,testoutput)
 
 .PHONY: langtools corba jaxp jaxws hotspot jdk nashorn images overlay-images install
 .PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only nashorn-only images-only overlay-images-only install-only
--- a/make/scripts/webrev.ksh	Tue Mar 26 09:13:00 2013 -0300
+++ b/make/scripts/webrev.ksh	Tue Apr 09 08:35:31 2013 -0300
@@ -1436,14 +1436,15 @@
 {
     rm -f $FLIST
     if [ -z "$Nflag" ]; then
-	print " File list from hg foutgoing $PWS ..."
+        print " File list from hg foutgoing $PWS ..."
         outgoing_from_mercurial_forest
         HG_LIST_FROM_COMMIT=1
     fi
     if [ ! -f $FLIST ]; then
         # hg commit hasn't been run see what is lying around
-	print "\n No outgoing, perhaps you haven't commited."
-	print " File list from hg fstatus -mard ...\c"
+        print "\n No outgoing, perhaps you haven't commited."
+        NO_OUTGOING=
+        print " File list from hg fstatus -mard ...\c"
         FSTAT_OPT=
         fstatus
         HG_LIST_FROM_COMMIT=0
@@ -1466,7 +1467,7 @@
     done >> $FLIST
 
     # Then all the added files
-    # But some of these could have been "moved" or renamed ones
+    # But some of these could have been "moved" or renamed ones or copied ones
     # so let's make sure we get the proper info
     # hg status -aC will produce something like:
     #	A subdir/File3
@@ -1474,8 +1475,11 @@
     #	  File4
     #	A subdir/File5
     # The first and last are simple addition while the middle one
-    # is a move/rename
-
+    # is a move/rename or a copy.  We can't distinguish from a rename vs a copy
+    # without also getting the status of removed files.  The middle case above
+    # is a rename if File4 is also shown a being removed.  If File4 is not a 
+    # removed file, then the middle case is a copy from File4 to subdir/File4
+    # FIXME - we're not distinguishing copy from rename
     $HGCMD -aC | $FILTER | while read LINE; do
 	ldone=""
 	while [ -z "$ldone" ]; do
@@ -1625,6 +1629,7 @@
         else
             # hg commit hasn't been run see what is lying around
             print "\n No outgoing, perhaps you haven't commited."
+            NO_OUTGOING=
         fi
 	# First let's list all the modified or deleted files
 
@@ -1638,8 +1643,12 @@
 	#	A subdir/File4
 	#	  File4
 	#	A subdir/File5
-	# The first and last are simple addition while the middle one
-	# is a move/rename
+        # The first and last are simple addition while the middle one
+        # is a move/rename or a copy.  We can't distinguish from a rename vs a copy
+        # without also getting the status of removed files.  The middle case above
+        # is a rename if File4 is also shown a being removed.  If File4 is not a 
+        # removed file, then the middle case is a copy from File4 to subdir/File4
+        # FIXME - we're not distinguishing copy from rename
 
 	hg status $STATUS_REV -aC | $FILTER >$FLIST.temp
 	while read LINE; do
@@ -1905,7 +1914,7 @@
 		fi
 	    fi
 	else
-	    # It's a rename (or a move), so let's make sure we move
+	    # It's a rename (or a move), or a copy, so let's make sure we move
 	    # to the right directory first, then restore it once done
 	    current_dir=`pwd`
 	    cd $CWS/$PDIR
@@ -2774,34 +2783,38 @@
 	    cleanse_rmfile="sed 's/^\(@@ [0-9+,-]*\) [0-9+,-]* @@$/\1 +0,0 @@/'"
 	    cleanse_newfile="sed 's/^@@ [0-9+,-]* \([0-9+,-]* @@\)$/@@ -0,0 \1/'"
 
-	    rm -f $WDIR/$DIR/$F.patch
-	    if [[ -z $rename ]]; then
-		if [ ! -f $ofile ]; then
-		    diff -u /dev/null $nfile | sh -c "$cleanse_newfile" \
-			> $WDIR/$DIR/$F.patch
-		elif [ ! -f $nfile ]; then
-		    diff -u $ofile /dev/null | sh -c "$cleanse_rmfile" \
-			> $WDIR/$DIR/$F.patch
-		else
-		    diff -u $ofile $nfile > $WDIR/$DIR/$F.patch
-		fi
-	    else
-		diff -u $ofile /dev/null | sh -c "$cleanse_rmfile" \
-		    > $WDIR/$DIR/$F.patch
-
-		diff -u /dev/null $nfile | sh -c "$cleanse_newfile" \
-		    >> $WDIR/$DIR/$F.patch
-
-	    fi
-
-
-	#
-	# Tack the patch we just made onto the accumulated patch for the
-	# whole wad.
-	#
-	    cat $WDIR/$DIR/$F.patch >> $WDIR/$WNAME.patch
-
-	    print " patch\c"
+            if [[ -v NO_OUTGOING ]];
+            then
+              # Only need to generate a patch file here if there are no commits in outgoing
+              rm -f $WDIR/$DIR/$F.patch
+              if [[ -z $rename ]]; then
+                  if [ ! -f $ofile ]; then
+                      diff -u /dev/null $nfile | sh -c "$cleanse_newfile" \
+                          > $WDIR/$DIR/$F.patch
+                  elif [ ! -f $nfile ]; then
+                      diff -u $ofile /dev/null | sh -c "$cleanse_rmfile" \
+                          > $WDIR/$DIR/$F.patch
+                  else
+                      diff -u $ofile $nfile > $WDIR/$DIR/$F.patch
+                  fi
+              else
+                  diff -u $ofile /dev/null | sh -c "$cleanse_rmfile" \
+                      > $WDIR/$DIR/$F.patch
+
+                  diff -u /dev/null $nfile | sh -c "$cleanse_newfile" \
+                      >> $WDIR/$DIR/$F.patch
+
+              fi
+
+
+            #
+            # Tack the patch we just made onto the accumulated patch for the
+            # whole wad.
+            #
+              cat $WDIR/$DIR/$F.patch >> $WDIR/$WNAME.patch
+            fi
+
+            print " patch\c"
 
 	    if [[ -f $ofile && -f $nfile && -z $mv_but_nodiff ]]; then
 
@@ -2894,6 +2907,32 @@
 	print
 done < $FLIST
 
+# Create the new style mercurial patch here using hg export -r [all-revs] -g -o $CHANGESETPATH
+if [[ $SCM_MODE == "mercurial" ]]; then
+  if [[ !(-v NO_OUTGOING) ]]; then
+    EXPORTCHANGESET="$WNAME.changeset"
+    CHANGESETPATH=${WDIR}/${EXPORTCHANGESET}
+    rm -f $CHANGESETPATH
+    touch $CHANGESETPATH
+    if [[ -n $ALL_CREV ]]; then
+      rev_opt=
+      for rev in $ALL_CREV; do
+        rev_opt="$rev_opt --rev $rev"
+      done
+    elif [[ -n $FIRST_CREV ]]; then
+      rev_opt="--rev $FIRST_CREV"
+    fi
+
+    if [[ -n $rev_opt ]]; then
+      (cd $CWS;hg export -g $rev_opt -o $CHANGESETPATH)
+      # echo "Created new-patch: $CHANGESETPATH" 1>&2
+      # Use it in place of the jdk.patch created above
+      rm -f $WDIR/$WNAME.patch
+    fi
+  set +x
+  fi
+fi
+
 frame_nav_js > $WDIR/ancnav.js
 frame_navigation > $WDIR/ancnav.html
 
@@ -2989,9 +3028,13 @@
 print "</td></tr>"
 
 if [[ -f $WDIR/$WNAME.patch ]]; then
-	print "<tr><th>Patch of changes:</th><td>"
-	print "<a href=\"$WNAME.patch\">$WNAME.patch</a></td></tr>"
+  print "<tr><th>Patch of changes:</th><td>"
+  print "<a href=\"$WNAME.patch\">$WNAME.patch</a></td></tr>"
+elif [[ -f $CHANGESETPATH ]]; then
+  print "<tr><th>Changeset:</th><td>"
+  print "<a href=\"$EXPORTCHANGESET\">$EXPORTCHANGESET</a></td></tr>"
 fi
+
 if [[ -f $WDIR/$WNAME.pdf ]]; then
 	print "<tr><th>Printable review:</th><td>"
 	print "<a href=\"$WNAME.pdf\">$WNAME.pdf</a></td></tr>"