OLD | NEW |
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 Loading... |
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)) |
OLD | NEW |