mirror of
https://github.com/facebook/sapling.git
synced 2025-01-07 14:10:42 +03:00
simplecache: ensure pathcopies doesn't cache special nodes
Summary: Same fix as D6788335, though not blocking anything. Use the public `node()` function on contexts and exclude None, nullid, and wdirid from caching. Reviewed By: DurhamG Differential Revision: D6790845 fbshipit-source-id: 4ccdc6889c993bb1a8379d50ecc92cb2aa03513d
This commit is contained in:
parent
34aebc68ca
commit
511a0a046f
@ -117,9 +117,10 @@ class pathcopiesserializer(object):
|
||||
def pathcopiesui(ui):
|
||||
def pathcopies(orig, x, y, match=None):
|
||||
func = lambda: orig(x, y, match=match)
|
||||
if x._node is not None and y._node is not None and not match:
|
||||
if (x.node() not in UNCACHEABLE_NODES and y.node()
|
||||
not in UNCACHEABLE_NODES and not match):
|
||||
key = 'pathcopies:%s:%s' % (
|
||||
node.hex(x._node), node.hex(y._node))
|
||||
node.hex(x.node()), node.hex(y.node()))
|
||||
return memoize(func, key, pathcopiesserializer, ui)
|
||||
return func()
|
||||
return pathcopies
|
||||
|
Loading…
Reference in New Issue
Block a user