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

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..89fc493308d523598491dc4b9fe6eeff1e10131c 100644
--- a/chrome/common/extensions/docs/server2/gitiles_file_system.py
+++ b/chrome/common/extensions/docs/server2/gitiles_file_system.py
@@ -233,11 +233,18 @@ 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':
+ '''The identity is always the same for GitilesFileSystems designated to
+ master, even if they are pinned to a specific commit.'''
not at google - send to devlin 2014/10/24 00:04:51 This seems more like a code comment than a docstri
Ken Rockot(use gerrit already) 2014/10/24 21:26:53 Done.
+ if self._branch == 'master':
+ str_id = '%s/%s/master' % (GITILES_BASE, GITILES_SRC_ROOT)
+ elif self._commit is not None:
+ str_id = '%s/%s/%s' % (GITILES_BASE, GITILES_SRC_ROOT, self._commit)
+ else:
str_id = '%s/%s/%s/%s' % (
GITILES_BASE, GITILES_SRC_ROOT, GITILES_BRANCHES_PATH, self._branch)
not at google - send to devlin 2014/10/24 00:04:51 These all share GITILES_BASE and GITILES_SRC_ROOT
Ken Rockot(use gerrit already) 2014/10/24 21:26:53 Done.
- else:
- str_id = '%s/%s' % (GITILES_BASE, GITILES_SRC_ROOT)
return '@'.join((self.__class__.__name__, StringIdentity(str_id)))
+
+ def GetVersion(self):
+ if self._commit is not None:
+ return self._commit
+ return None
not at google - send to devlin 2014/10/24 00:04:51 return self._commit ?
Ken Rockot(use gerrit already) 2014/10/24 21:26:54 Lol. Right. Done.

Powered by Google App Engine
This is Rietveld 408576698