mercurial/obsolete.py
changeset 32902 9d472b219fb0
parent 32841 e65ff29dbeb0
child 33136 765c6ab07a88
--- a/mercurial/obsolete.py	Fri Jun 16 10:13:44 2017 -0700
+++ b/mercurial/obsolete.py	Mon May 01 05:57:36 2017 +0200
@@ -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