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 All, Future | 9 from future import All, Future |
10 from path_util import AssertIsDirectory, IsDirectory, ToDirectory | 10 from path_util import AssertIsDirectory, IsDirectory, ToDirectory |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 for f in self.ReadSingle(root).Get(): | 162 for f in self.ReadSingle(root).Get(): |
163 if IsDirectory(f): | 163 if IsDirectory(f): |
164 dirs.append(f) | 164 dirs.append(f) |
165 else: | 165 else: |
166 files.append(f) | 166 files.append(f) |
167 # Update the cache. This is a root -> (dirs, files, version) mapping. | 167 # Update the cache. This is a root -> (dirs, files, version) mapping. |
168 self._walk_cache.Set(root, (dirs, files, root_stat.version)) | 168 self._walk_cache.Set(root, (dirs, files, root_stat.version)) |
169 return dirs, files | 169 return dirs, files |
170 return self._file_system.Walk(root, depth=depth, file_lister=file_lister) | 170 return self._file_system.Walk(root, depth=depth, file_lister=file_lister) |
171 | 171 |
| 172 def GetCommitID(self): |
| 173 return self._file_system.GetCommitID() |
| 174 |
| 175 def GetPreviousCommitID(self): |
| 176 return self._file_system.GetPreviousCommitID() |
| 177 |
172 def GetIdentity(self): | 178 def GetIdentity(self): |
173 return self._file_system.GetIdentity() | 179 return self._file_system.GetIdentity() |
174 | 180 |
175 def __repr__(self): | 181 def __repr__(self): |
176 return '%s of <%s>' % (type(self).__name__, repr(self._file_system)) | 182 return '%s of <%s>' % (type(self).__name__, repr(self._file_system)) |
OLD | NEW |