File not marked as 'M' when contents differ from repo

Matt Mackall mpm at selenic.com
Fri Jul 6 10:58:21 CDT 2007


On Fri, Jul 06, 2007 at 11:28:02AM +0200, Markus F.X.J. Oberhumer wrote:
> Matt Mackall wrote:
> >On Thu, Jul 05, 2007 at 11:30:24AM +0100, Jim Hague wrote:
> >>In article <loom.20070704T211330-427 at post.gmane.org>, I wrote:
> >>>I've tried to reproduce it by hand, but so far without success.
> >>After a bit more fiddling this morning, it looks like the problem
> >>is that a change made in the same second as an update won't be
> >>detected.
> >>
> >>$ rm *
> >>$ hg update -C 38 ; echo "1.1.1" > buildno
> >>7 files updated, 0 files merged, 0 files removed, 0 files unresolved
> >>$ hg status
> >>$ more buildno
> >>1.1.1
> >>$ hg cat buildno
> >>1.1.0
> >
> >Changes that don't change file time OR size OR mode are indeed not
> >detected.
> >
> 
> rsync has an option "--checksum" to base it's view of changed files on a 
> checksum (and not mod-time & size).
> 
> Maybe it would be easy to add such a global option to hg ?

Doesn't help. The problem is knowing the problem exists. Once you're
aware of it, you can just as easily add "sleep 1" to your script as
add "--checksum".

You only hit this problem when:

a) you've got a script that edits a file within less than a second of
committing or editing a file
b) your edit doesn't change the size of the file

Which means it basically only hits people who are fiddling with
version numbers.

-- 
Mathematics is the supreme nostalgia of our time.


More information about the Mercurial mailing list