##// END OF EJS Templates
filecache: abstract the fetching of the list of tracked file...
marmoute -
r48850:1c447fb8 stable
parent child Browse files
Show More
@@ -1662,6 +1662,9 b' class filecache(object):'
1662 def __init__(self, *paths):
1662 def __init__(self, *paths):
1663 self.paths = paths
1663 self.paths = paths
1664
1664
1665 def tracked_paths(self, obj):
1666 return [self.join(obj, path) for path in self.paths]
1667
1665 def join(self, obj, fname):
1668 def join(self, obj, fname):
1666 """Used to compute the runtime path of a cached file.
1669 """Used to compute the runtime path of a cached file.
1667
1670
@@ -1690,7 +1693,7 b' class filecache(object):'
1690 if entry.changed():
1693 if entry.changed():
1691 entry.obj = self.func(obj)
1694 entry.obj = self.func(obj)
1692 else:
1695 else:
1693 paths = [self.join(obj, path) for path in self.paths]
1696 paths = self.tracked_paths(obj)
1694
1697
1695 # We stat -before- creating the object so our cache doesn't lie if
1698 # We stat -before- creating the object so our cache doesn't lie if
1696 # a writer modified between the time we read and stat
1699 # a writer modified between the time we read and stat
@@ -1709,7 +1712,7 b' class filecache(object):'
1709 if self.name not in obj._filecache:
1712 if self.name not in obj._filecache:
1710 # we add an entry for the missing value because X in __dict__
1713 # we add an entry for the missing value because X in __dict__
1711 # implies X in _filecache
1714 # implies X in _filecache
1712 paths = [self.join(obj, path) for path in self.paths]
1715 paths = self.tracked_paths(obj)
1713 ce = filecacheentry(paths, False)
1716 ce = filecacheentry(paths, False)
1714 obj._filecache[self.name] = ce
1717 obj._filecache[self.name] = ce
1715 else:
1718 else:
General Comments 0
You need to be logged in to leave comments. Login now