[PATCH] mac: ignore resource fork when checking file sizes

Matt Mackall mpm at selenic.com
Thu Jan 14 23:11:36 UTC 2016


# HG changeset patch
# User Matt Mackall <mpm at selenic.com>
# Date 1452796635 21600
#      Thu Jan 14 12:37:15 2016 -0600
# Node ID 6896cdc85be34f4b343880c5a6201f8630dedb7c
# Parent  443848eece189002c542339dc1cf84f49a94c824
mac: ignore resource fork when checking file sizes

Some evil evil awful tool adds resource forks to files it's comparing.
Our Mac-specific code to do bulk stats was accidentally using "total
size" which includes those forks in the file size, causing them to be
reported as modified. This changes it to only care about the normal
data size and thus agree with what Mercurial's expecting.

diff -r 443848eece18 -r 6896cdc85be3 mercurial/osutil.c
--- a/mercurial/osutil.c	Wed Jan 13 15:47:37 2016 -0600
+++ b/mercurial/osutil.c	Thu Jan 14 12:37:15 2016 -0600
@@ -458,7 +458,7 @@
 	requested_attr.bitmapcount = ATTR_BIT_MAP_COUNT;
 	requested_attr.commonattr = (ATTR_CMN_NAME | ATTR_CMN_OBJTYPE |
 				     ATTR_CMN_MODTIME | ATTR_CMN_ACCESSMASK);
-	requested_attr.fileattr = ATTR_FILE_TOTALSIZE;
+	requested_attr.fileattr = ATTR_FILE_DATALENGTH;
 
 	*fallback = false;
 


More information about the Mercurial-devel mailing list