[PATCH 3 of 3] util: get rid of statmtimesec

Yuya Nishihara yuya at tcha.org
Sun Nov 22 21:52:48 CST 2015


On Sun, 22 Nov 2015 15:15:25 -0600, Matt Mackall wrote:
> On Thu, 2015-11-19 at 22:55 -0800, Pierre-Yves David wrote:
> > 
> > On 11/19/2015 11:27 AM, Matt Mackall wrote:
> > > On Wed, 2015-11-18 at 16:28 -0800, Pierre-Yves David wrote:
> > > > 
> > > > On 11/18/2015 08:18 AM, Bryan O'Sullivan wrote:
> > > > > # HG changeset patch
> > > > > # User Bryan O'Sullivan <bos at serpentine.com>
> > > > > # Date 1447863394 18000
> > > > > #      Wed Nov 18 11:16:34 2015 -0500
> > > > > # Node ID 220904f144652a738557a9a8c470ce9cbd8e62f2
> > > > > # Parent  d2569b9eab3d2cfa6cad3cafcec60a66634412af
> > > > > util: get rid of statmtimesec
> > > > 
> > > > This is good stuff, Thanks goes to Laurent to walk me through it.
> > > > pushed
> > > > to the clowncopter.
> > > 
> > > Immediately blew up for me because it introduces a hard Python/C
> > > API
> > > version interdependency of the sort we've been studiously trying to
> > > avoid. I'll post an alternate fix in a moment.
> > 
> > Could we have failed forward here and kept both the old and new code 
> > around. Installing a compatible version at runtime?
> 
> That was of course my first thought. But because the call itself is
> buried deep in a fast-path, the answer is basically "you can't fix it
> without duplicating a lot of important code".
> 
> If people really care about the filecache's timestamp resolution, I
> would much rather add a simple C helper to get (seconds, nanoseconds)
> integers from the OS than waste any more time screwing around with
> floating point timestamps and its attendant problems.

Writing a portable C function won't be simple. Python uses macros provided
by configure.

https://hg.python.org/cpython/file/v2.7.10/Modules/posixmodule.c#l1504


More information about the Mercurial-devel mailing list