mercurial/obsolete.py
changeset 32884 9d472b219fb0
parent 32822 e65ff29dbeb0
child 33129 765c6ab07a88
equal deleted inserted replaced
32883:0a41902879d3 32884:9d472b219fb0
  1271 # mapping of 'set-name' -> <function to compute this set>
  1271 # mapping of 'set-name' -> <function to compute this set>
  1272 cachefuncs = {}
  1272 cachefuncs = {}
  1273 def cachefor(name):
  1273 def cachefor(name):
  1274     """Decorator to register a function as computing the cache for a set"""
  1274     """Decorator to register a function as computing the cache for a set"""
  1275     def decorator(func):
  1275     def decorator(func):
  1276         assert name not in cachefuncs
  1276         if name in cachefuncs:
       
  1277             msg = "duplicated registration for volatileset '%s' (existing: %r)"
       
  1278             raise error.ProgrammingError(msg % (name, cachefuncs[name]))
  1277         cachefuncs[name] = func
  1279         cachefuncs[name] = func
  1278         return func
  1280         return func
  1279     return decorator
  1281     return decorator
  1280 
  1282 
  1281 def getrevs(repo, name):
  1283 def getrevs(repo, name):