equal
deleted
inserted
replaced
198 The string 'data/' at the beginning is replaced with 'dh/', if the hashed |
198 The string 'data/' at the beginning is replaced with 'dh/', if the hashed |
199 encoding was used. |
199 encoding was used. |
200 ''' |
200 ''' |
201 if not path.startswith('data/'): |
201 if not path.startswith('data/'): |
202 return path |
202 return path |
203 # escape directories ending with .i and .d |
203 res = '/'.join(auxencode(encodefilename(path))) |
204 path = encodedir(path) |
|
205 ndpath = path[len('data/'):] |
|
206 res = 'data/' + '/'.join(auxencode(encodefilename(ndpath))) |
|
207 if len(res) > _maxstorepathlen: |
204 if len(res) > _maxstorepathlen: |
|
205 path = encodedir(path) |
208 digest = _sha(path).hexdigest() |
206 digest = _sha(path).hexdigest() |
209 parts = auxencode(lowerencode(ndpath)) |
207 parts = auxencode(lowerencode(path))[1:] |
210 _root, ext = os.path.splitext(parts[-1]) |
208 _root, ext = os.path.splitext(parts[-1]) |
211 basename = parts[-1] |
209 basename = parts[-1] |
212 sdirs = [] |
210 sdirs = [] |
213 for p in parts[:-1]: |
211 for p in parts[:-1]: |
214 d = p[:_dirprefixlen] |
212 d = p[:_dirprefixlen] |