##// END OF EJS Templates
store: keep an accumulated length for the shorted dirs in _hybridencode...
Adrian Buehlmann -
r17588:3d789dd7 default
parent child Browse files
Show More
@@ -204,15 +204,20 b' def _hybridencode(path, auxencode):'
204 basename = parts[-1]
204 basename = parts[-1]
205 _root, ext = os.path.splitext(basename)
205 _root, ext = os.path.splitext(basename)
206 sdirs = []
206 sdirs = []
207 sdirslen = 0
207 for p in parts[:-1]:
208 for p in parts[:-1]:
208 d = p[:_dirprefixlen]
209 d = p[:_dirprefixlen]
209 if d[-1] in '. ':
210 if d[-1] in '. ':
210 # Windows can't access dirs ending in period or space
211 # Windows can't access dirs ending in period or space
211 d = d[:-1] + '_'
212 d = d[:-1] + '_'
212 t = '/'.join(sdirs) + '/' + d
213 if sdirslen == 0:
213 if len(t) > _maxshortdirslen:
214 t = len(d)
214 break
215 else:
216 t = sdirslen + 1 + len(d)
217 if t > _maxshortdirslen:
218 break
215 sdirs.append(d)
219 sdirs.append(d)
220 sdirslen = t
216 dirs = '/'.join(sdirs)
221 dirs = '/'.join(sdirs)
217 if len(dirs) > 0:
222 if len(dirs) > 0:
218 dirs += '/'
223 dirs += '/'
General Comments 0
You need to be logged in to leave comments. Login now