comparison hgext/lfs/blobstore.py @ 35396:c8edeb03ca94

lfs: correct the directory list value returned by lfsvfs.walk() Spotted by Yuya.
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 12 Dec 2017 20:22:38 -0500
parents 79968f91ad0c
children f98fac24b757
comparison
equal deleted inserted replaced
35395:12055fb3ba30 35396:c8edeb03ca94
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.