one byte change to file not detected ?

BuraphaLinux Server buraphalinuxserver at gmail.com
Wed Feb 20 11:07:38 CST 2008


The attached script shows that on my system, mercurial cannot detect a
1 byte difference in a file.  Sometimes the script works, but most of
the time it fails.  I wonder if mercurial is using the file size and
time to skip doing a real byte-by-byte comparison, and my clock
granularity is not fine enough?  I am willing to pay the penalty of
the slowdown if I can force a byte-by-byte comparison of every file
every time, but I don't know how to turn that on.

If I add a line 'sleep 1' after the first commit, then the script
correctly works and I get 2 revisions instead of the dreaded 'nothing
changed' message.

Is this a known issue?  Should I make a wrapper for hg that just
always does a sleep after each operation?

I ran the tests with this:

for x in $(seq 1 10); do ./PANIC; done
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PANIC
Type: application/octet-stream
Size: 2622 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial/attachments/20080221/a0e2a66c/attachment.obj 


More information about the Mercurial mailing list