equal
deleted
inserted
replaced
32 if not _lfsre.match(path): |
32 if not _lfsre.match(path): |
33 raise error.ProgrammingError('unexpected lfs path: %s' % path) |
33 raise error.ProgrammingError('unexpected lfs path: %s' % path) |
34 return super(lfsvfs, self).join(path[0:2], path[2:]) |
34 return super(lfsvfs, self).join(path[0:2], path[2:]) |
35 |
35 |
36 def walk(self, path=None, onerror=None): |
36 def walk(self, path=None, onerror=None): |
37 """Yield (dirpath, '', oids) tuple for blobs under path |
37 """Yield (dirpath, [], oids) tuple for blobs under path |
38 |
38 |
39 Oids only exist in the root of this vfs, so dirpath is always ''. |
39 Oids only exist in the root of this vfs, so dirpath is always ''. |
40 """ |
40 """ |
41 root = os.path.normpath(self.base) |
41 root = os.path.normpath(self.base) |
42 # when dirpath == root, dirpath[prefixlen:] becomes empty |
42 # when dirpath == root, dirpath[prefixlen:] becomes empty |
51 # Silently skip unexpected files and directories |
51 # Silently skip unexpected files and directories |
52 if len(dirpath) == 2: |
52 if len(dirpath) == 2: |
53 oids.extend([dirpath + f for f in files |
53 oids.extend([dirpath + f for f in files |
54 if _lfsre.match(dirpath + f)]) |
54 if _lfsre.match(dirpath + f)]) |
55 |
55 |
56 yield ('', '', oids) |
56 yield ('', [], oids) |
57 |
57 |
58 class filewithprogress(object): |
58 class filewithprogress(object): |
59 """a file-like object that supports __len__ and read. |
59 """a file-like object that supports __len__ and read. |
60 |
60 |
61 Useful to provide progress information for how many bytes are read. |
61 Useful to provide progress information for how many bytes are read. |