Mercurial > hg > mercurial-source
changeset 33667:9d472b219fb0
obsolete: use ProgrammingError over assert for volatile set registration
We have ProgrammingError now.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Mon, 01 May 2017 05:57:36 +0200 |
parents | 0a41902879d3 |
children | 8e02829bec61 |
files | mercurial/obsolete.py |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/obsolete.py +++ b/mercurial/obsolete.py @@ -1273,7 +1273,9 @@ 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