| Index: chrome/common/extensions/docs/server2/host_file_system_provider.py
|
| diff --git a/chrome/common/extensions/docs/server2/host_file_system_provider.py b/chrome/common/extensions/docs/server2/host_file_system_provider.py
|
| index b19592e2e696c00ac521036a86a40da4f68ce1f5..7d35a5b082d30571154222ba17f2c6b724867fd9 100644
|
| --- a/chrome/common/extensions/docs/server2/host_file_system_provider.py
|
| +++ b/chrome/common/extensions/docs/server2/host_file_system_provider.py
|
| @@ -21,7 +21,8 @@ class HostFileSystemProvider(object):
|
| pinned_commit=None,
|
| default_master_instance=None,
|
| offline=False,
|
| - constructor_for_test=None):
|
| + constructor_for_test=None,
|
| + cache_only=False):
|
| '''
|
| |object_store_creator|
|
| Provides caches for file systems that need one.
|
| @@ -35,12 +36,16 @@ class HostFileSystemProvider(object):
|
| If True all provided file systems will be wrapped in an OfflineFileSystem.
|
| |constructor_for_test|
|
| Provides a custom constructor rather than creating GitilesFileSystems.
|
| + |cache_only|
|
| + If True, all provided file systems will be cache-only, meaning that cache
|
| + misses will result in errors rather than cache updates.
|
| '''
|
| self._object_store_creator = object_store_creator
|
| self._pinned_commit = pinned_commit
|
| self._default_master_instance = default_master_instance
|
| self._offline = offline
|
| self._constructor_for_test = constructor_for_test
|
| + self._cache_only = cache_only
|
|
|
| @memoize
|
| def GetMaster(self, commit=None):
|
| @@ -59,10 +64,6 @@ class HostFileSystemProvider(object):
|
| if self._default_master_instance is not None:
|
| return self._default_master_instance
|
| return self._Create('master', commit=self._pinned_commit)
|
| - if self._pinned_commit is not None:
|
| - # XXX(ahernandez): THIS IS WRONG. Should be
|
| - # commit = Oldest(commit, self._pinned_commit).
|
| - commit = min(commit, self._pinned_commit)
|
| return self._Create('master', commit=commit)
|
|
|
| @memoize
|
| @@ -85,13 +86,19 @@ class HostFileSystemProvider(object):
|
| an Offline file system if the offline flag is set, and finally wraps it in
|
| a Caching file system.
|
| '''
|
| + empty_stat_cache = True
|
| if self._constructor_for_test is not None:
|
| file_system = self._constructor_for_test(branch=branch, commit=commit)
|
| else:
|
| file_system = GitilesFileSystem.Create(branch=branch, commit=commit)
|
| + # GitilesFileSystem supports the notion of unstable identity, which means
|
| + # its CachingFileSystem can use a persistent stat info cache without
|
| + # breaking everything.
|
| + empty_stat_cache = False
|
| if self._offline:
|
| file_system = OfflineFileSystem(file_system)
|
| - return CachingFileSystem(file_system, self._object_store_creator)
|
| + return CachingFileSystem(file_system, self._object_store_creator,
|
| + fail_on_miss=self._cache_only, empty_stat_cache=empty_stat_cache)
|
|
|
| @staticmethod
|
| def ForLocal(object_store_creator, **optargs):
|
|
|