This is an archive of the discontinued Mercurial Phabricator instance.

scmutil: rewrite docstring for filecache
ClosedPublic

Authored by indygreg on Jul 13 2018, 5:26 PM.

Details

Summary

The old docstring was incorrect in that it said that subsequent
calls perform a stat() and refresh the object if things change.
This is not how things work: get populates obj.dict[self.sname]
with the result of the decorated function and returns this value
without validation on subsequent calls, if available.

The correct usage of this type is kinda wonky. It would probably
benefit from a refactor. But I don't have time to do that right
now. But we can change the docstring so others aren't entrapped by
its lies (like I was when using repofilecache in a Mozilla extension).

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

indygreg created this revision.Jul 13 2018, 5:26 PM
This revision was automatically updated to reflect the committed changes.