hgext/remotefilelog/repack.py
changeset 42057 566daffc607d
parent 41806 118c1ec4f31b
child 42497 df1419c5756a
equal deleted inserted replaced
42056:4950ae4d034f 42057:566daffc607d
   152     # historypacks.
   152     # historypacks.
   153     VALIDEXTS = [".datapack", ".dataidx"]
   153     VALIDEXTS = [".datapack", ".dataidx"]
   154 
   154 
   155     # Either an oversize index or datapack will trigger cleanup of the whole
   155     # Either an oversize index or datapack will trigger cleanup of the whole
   156     # pack:
   156     # pack:
   157     oversized = set([os.path.splitext(path)[0] for path, ftype, stat in files
   157     oversized = {os.path.splitext(path)[0] for path, ftype, stat in files
   158         if (stat.st_size > maxsize and (os.path.splitext(path)[1]
   158         if (stat.st_size > maxsize and (os.path.splitext(path)[1]
   159                                         in VALIDEXTS))])
   159                                         in VALIDEXTS))}
   160 
   160 
   161     for rootfname in oversized:
   161     for rootfname in oversized:
   162         rootpath = os.path.join(folder, rootfname)
   162         rootpath = os.path.join(folder, rootfname)
   163         for ext in VALIDEXTS:
   163         for ext in VALIDEXTS:
   164             path = rootpath + ext
   164             path = rootpath + ext