Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3565)

Unified Diff: chrome/common/extensions/docs/server2/gitiles_file_system.py

Issue 660383002: Docserver: Persist stat cache for versioned file systems (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/server2/gitiles_file_system.py
diff --git a/chrome/common/extensions/docs/server2/gitiles_file_system.py b/chrome/common/extensions/docs/server2/gitiles_file_system.py
index 2962235da84e6c0a1d6f71824ea7694e6a08883b..5b067f3fffb665e53e1cc1d0c4ea8b98b21381ae 100644
--- a/chrome/common/extensions/docs/server2/gitiles_file_system.py
+++ b/chrome/common/extensions/docs/server2/gitiles_file_system.py
@@ -233,11 +233,15 @@ class GitilesFileSystem(FileSystem):
return self._ResolveFetchContent(path, fetch_future).Then(stat)
def GetIdentity(self):
- # NOTE: Do not use commit information to create the string identity.
- # Doing so will mess up caching.
- if self._commit is None and self._branch != 'master':
- str_id = '%s/%s/%s/%s' % (
- GITILES_BASE, GITILES_SRC_ROOT, GITILES_BRANCHES_PATH, self._branch)
+ if self._branch == 'master':
+ # A master FS always carries the same identity even if pinned to a commit.
+ str_id = 'master'
+ elif self._commit is not None:
+ str_id = self._commit
else:
- str_id = '%s/%s' % (GITILES_BASE, GITILES_SRC_ROOT)
- return '@'.join((self.__class__.__name__, StringIdentity(str_id)))
+ str_id = '%s/%s' % (GITILES_BRANCHES_PATH, self._branch)
+ return '@'.join(self.__class__.__name__, StringIdentity(
+ '%s/%s/%s' % (GITILES_BASE, GITILES_SRC_ROOT, str_id)))
+
+ def GetVersion(self):
+ return self._commit

Powered by Google App Engine
This is Rietveld 408576698