mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 15:57:43 +03:00
obsolete: use ProgrammingError over assert for volatile set registration
We have ProgrammingError now.
This commit is contained in:
parent
7059c57ed3
commit
f9505c66f4
@ -1273,7 +1273,9 @@ cachefuncs = {}
|
||||
def cachefor(name):
|
||||
"""Decorator to register a function as computing the cache for a set"""
|
||||
def decorator(func):
|
||||
assert name not in cachefuncs
|
||||
if name in cachefuncs:
|
||||
msg = "duplicated registration for volatileset '%s' (existing: %r)"
|
||||
raise error.ProgrammingError(msg % (name, cachefuncs[name]))
|
||||
cachefuncs[name] = func
|
||||
return func
|
||||
return decorator
|
||||
|
Loading…
Reference in New Issue
Block a user