mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
store: refactor splitting off of "data/" in _hybridencode()
encodefilename() already calls encodedir(). Note that encodedir() skips the encoding if the path doesn't start with "data/".
This commit is contained in:
parent
cad875fb81
commit
5b06fb5a39
@ -200,13 +200,11 @@ def _hybridencode(path, auxencode):
|
||||
'''
|
||||
if not path.startswith('data/'):
|
||||
return path
|
||||
# escape directories ending with .i and .d
|
||||
path = encodedir(path)
|
||||
ndpath = path[len('data/'):]
|
||||
res = 'data/' + '/'.join(auxencode(encodefilename(ndpath)))
|
||||
res = '/'.join(auxencode(encodefilename(path)))
|
||||
if len(res) > _maxstorepathlen:
|
||||
path = encodedir(path)
|
||||
digest = _sha(path).hexdigest()
|
||||
parts = auxencode(lowerencode(ndpath))
|
||||
parts = auxencode(lowerencode(path))[1:]
|
||||
_root, ext = os.path.splitext(parts[-1])
|
||||
basename = parts[-1]
|
||||
sdirs = []
|
||||
|
Loading…
Reference in New Issue
Block a user