hg diff of changes from before a file move

Phil Race philip.race at oracle.com
Mon Aug 25 21:59:33 UTC 2014


Since the mega-move I am running into the annoyance that hg diff
won't show changes made before the move unless you first work out
the full path of the file from before it was moved - eg by finding the
changeset that caused the move -  and hoping the file only moved once.
See full example of this below.

Is there a magic hg flag I am missing (I hoped --follow would work for 
hg diff but
it does not) ?
Or does anyone have a script that will automate this for you ?
Perhaps by running hg log to find the (right) move changeset and parsing 
the output
to get the location prior to the move.

-phil.

====================

$ hg diff -r 673c8a68d52d -r f08705540498 
src/java.desktop/share/native/liblcms/cmscam02.c
diff --git a/src/share/native/sun/java2d/cmm/lcms/cmscam02.c 
b/src/java.desktop/share/native/liblcms/cmscam02.c
copy from src/share/native/sun/java2d/cmm/lcms/cmscam02.c
copy to src/java.desktop/share/native/liblcms/cmscam02.c

=================
$ hg log --follow src/java.desktop/share/native/liblcms/cmscam02.c
changeset:   10520:f08705540498
parent:      10505:88856f58680f
user:        chegar
date:        Sun Aug 17 15:54:13 2014 +0100
summary:     8054834: Modular Source Code

changeset:   9790:673c8a68d52d
user:        prr
date:        Wed Jan 22 09:39:16 2014 -0800
summary:     8029750: Enhance LCMS color processing

changeset:   6031:cc998992dc32
parent:      5948:117eed515e42
user:        bae
date:        Wed Oct 24 05:30:34 2012 +0400
summary:     7053526: Upgrade JDK 8 to use Little CMS 2.4

.....
.....
===================

$ hg diff -r  cc998992dc32 -r 673c8a68d52d 
src/java.desktop/share/native/liblcms/cmscam02.c

===================
$  hg diff -r  cc998992dc32 -r 673c8a68d52d 
src/share/native/sun/java2d/cmm/lcms/cmscam02.c
diff --git a/src/share/native/sun/java2d/cmm/lcms/cmscam02.c 
b/src/share/native/sun/java2d/cmm/lcms/cmscam02.c
--- a/src/share/native/sun/java2d/cmm/lcms/cmscam02.c
+++ b/src/share/native/sun/java2d/cmm/lcms/cmscam02.c
@@ -467,6 +467,7 @@
      CAM02COLOR clr;
      cmsCIECAM02* lpMod = (cmsCIECAM02*) hModel;

+    memset(&clr, 0, sizeof(clr));
      _cmsAssert(lpMod != NULL);
      _cmsAssert(pIn != NULL);
      _cmsAssert(pOut != NULL);
@@ -491,6 +492,7 @@
      CAM02COLOR clr;
      cmsCIECAM02* lpMod = (cmsCIECAM02*) hModel;

+    memset(&clr, 0, sizeof(clr));
      _cmsAssert(lpMod != NULL);
      _cmsAssert(pIn != NULL);
      _cmsAssert(pOut != NULL);

==================


More information about the jdk9-dev mailing list