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

Side by Side Diff: chrome/common/extensions/docs/server2/caching_file_system.py

Issue 491653002: Docserver: Use GitilesFileSystem instead of SubversionFileSystem (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import posixpath 5 import posixpath
6 import sys 6 import sys
7 7
8 from file_system import FileSystem, StatInfo, FileNotFoundError 8 from file_system import FileSystem, StatInfo, FileNotFoundError
9 from future import Future 9 from future import Future
10 from path_util import IsDirectory, ToDirectory 10 from path_util import IsDirectory, ToDirectory
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 # Update the cache. This is a path -> (data, version) mapping. 117 # Update the cache. This is a path -> (data, version) mapping.
118 self._read_object_store.SetMulti( 118 self._read_object_store.SetMulti(
119 dict((path, (new_result, stat_futures[path].Get().version)) 119 dict((path, (new_result, stat_futures[path].Get().version))
120 for path, new_result in new_results.iteritems())) 120 for path, new_result in new_results.iteritems()))
121 new_results.update(fresh_data) 121 new_results.update(fresh_data)
122 return new_results 122 return new_results
123 # Read in the values that were uncached or old. 123 # Read in the values that were uncached or old.
124 return self._file_system.Read(set(paths) - set(fresh_data.iterkeys()), 124 return self._file_system.Read(set(paths) - set(fresh_data.iterkeys()),
125 skip_not_found=skip_not_found).Then(next) 125 skip_not_found=skip_not_found).Then(next)
126 126
127 def GetCommitID(self):
128 return self._file_system.GetCommitID()
129
130 def GetPreviousCommitID(self):
131 return self._file_system.GetPreviousCommitID()
132
127 def GetIdentity(self): 133 def GetIdentity(self):
128 return self._file_system.GetIdentity() 134 return self._file_system.GetIdentity()
129 135
130 def __repr__(self): 136 def __repr__(self):
131 return '%s of <%s>' % (type(self).__name__, repr(self._file_system)) 137 return '%s of <%s>' % (type(self).__name__, repr(self._file_system))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698