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..64abd94349633776515b442adc0daccf22fbc493 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 ('%s/%s@' % (GITILES_BASE, GITILES_SRC_ROOT)).join( |
not at google - send to devlin
2014/10/24 23:36:07
why does the string end with an '@'?
Ken Rockot(use gerrit already)
2014/10/24 23:43:17
I... don't really know. I crossed some wires when
|
+ (self.__class__.__name__, StringIdentity(str_id))) |
+ |
+ def GetVersion(self): |
+ return self._commit |