Page MenuHomePhabricator

cleanup: use stat_result[stat.ST_MTIME] instead of stat_result.st_mtime
ClosedPublic

Authored by durin42 on Mar 5 2018, 4:08 PM.

Details

Summary

The latter is floating point by default, and we've been doing
os.stat_float_times(False). Unfortunately, os.stat_float_times was
removed between Python 3.7.0a1 and 3.7.0b2, so we have to stop using
it.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

durin42 created this revision.Mar 5 2018, 4:08 PM
indygreg added inline comments.
mercurial/cext/osutil.c
125 ↗(On Diff #6656)

Is this valid for Python 2? The passed argument will likely be a PyInt on Python 2. I thought PyLong_AsLong only operates on int types?

durin42 added inline comments.Mar 5 2018, 7:58 PM
mercurial/cext/osutil.c
125 ↗(On Diff #6656)

Seems to (I also could have sworn int and long became the same thing in 2.6), as it passes the entire testsuite.

durin42 updated this revision to Diff 6676.Mar 6 2018, 1:58 PM
durin42 updated this revision to Diff 6679.Mar 6 2018, 2:02 PM
yuja accepted this revision.Mar 8 2018, 7:57 AM
This revision is now accepted and ready to land.Mar 8 2018, 7:57 AM
yuja added a comment.Mar 8 2018, 8:00 AM

Queued, thanks.

Maybe we'll need to update cffi code as a follow-up.

mercurial/chgserver.py
550–552

Fixed name conflicts and st_mtime oversight.

This revision was automatically updated to reflect the committed changes.