diff -r 15e85dded933 -r 1b25c648d5b7 mercurial/util.py --- a/mercurial/util.py Mon Jun 12 15:34:31 2017 -0700 +++ b/mercurial/util.py Mon Jun 12 15:34:31 2017 -0700 @@ -1519,6 +1519,11 @@ stat = None return cls(stat) + @classmethod + def fromfp(cls, fp): + stat = os.fstat(fp.fileno()) + return cls(stat) + __hash__ = object.__hash__ def __eq__(self, old):