mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 16:31:02 +03:00
fastannotate: remove mtime check for isuptodate
Summary: The mtime check seems to cause more trouble than benefit - often the annotate cache was treated "not up-to-date", while it is up-to-date actually. Test Plan: `arc unit` Reviewers: #sourcecontrol, mjpieters Reviewed By: mjpieters Subscribers: mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4318077 Signature: t1:4318077:1481723495:d4e0ab5e7ef5a520520c07fb7246230639b9b9b4
This commit is contained in:
parent
b1506f0277
commit
76fcdc8d6d
@ -235,19 +235,11 @@ class _annotatecontext(object):
|
|||||||
f = self._resolvefctx(master, resolverev=True)
|
f = self._resolvefctx(master, resolverev=True)
|
||||||
# choose linkrev instead of introrev as the check is meant to be
|
# choose linkrev instead of introrev as the check is meant to be
|
||||||
# *fast*.
|
# *fast*.
|
||||||
linknode = self.repo.changelog.rev(f.linkrev())[-1]
|
linknode = self.repo.changelog.node(f.linkrev())
|
||||||
if not strict and lastnode:
|
if not strict and lastnode and linknode != lastnode:
|
||||||
# perform the mtime check first, it's faster than loading the
|
# check if f.node() is in the revmap. note: this loads the
|
||||||
# revamp.
|
# revmap and can be slow.
|
||||||
try:
|
return self.revmap.hsh2rev(linknode) is not None
|
||||||
mtime = os.stat(self.revmappath).st_mtime
|
|
||||||
except OSError: # not fatal
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
if f.date()[0] < mtime:
|
|
||||||
# if mtime check passes, check if f.node() is in the
|
|
||||||
# revmap. note: this loads the revmap and can be slow.
|
|
||||||
return self.revmap.hsh2rev(linknode) is not None
|
|
||||||
# avoid resolving old manifest, or slow adjustlinkrev to be fast,
|
# avoid resolving old manifest, or slow adjustlinkrev to be fast,
|
||||||
# false negatives are acceptable in this case.
|
# false negatives are acceptable in this case.
|
||||||
return linknode == lastnode
|
return linknode == lastnode
|
||||||
|
Loading…
Reference in New Issue
Block a user