##// END OF EJS Templates
store: move encode lambda logic into fncachestore...
Adrian Buehlmann -
r17591:9a5c2ecd default
parent child Browse files
Show More
@@ -396,8 +396,18 b' class _fncacheopener(scmutil.abstractope'
396 396 self.fncache.add(path)
397 397 return self.opener(self.encode(path), mode, *args, **kw)
398 398
399 def _plainhybridencode(f):
400 return _hybridencode(f, False)
401
402 def _dothybridencode(f):
403 return _hybridencode(f, True)
404
399 405 class fncachestore(basicstore):
400 def __init__(self, path, openertype, encode):
406 def __init__(self, path, openertype, dotencode):
407 if dotencode:
408 encode = _dothybridencode
409 else:
410 encode = _plainhybridencode
401 411 self.encode = encode
402 412 self.path = path + '/store'
403 413 self.pathsep = self.path + '/'
@@ -444,8 +454,6 b' class fncachestore(basicstore):'
444 454 def store(requirements, path, openertype):
445 455 if 'store' in requirements:
446 456 if 'fncache' in requirements:
447 de = 'dotencode' in requirements
448 encode = lambda f: _hybridencode(f, de)
449 return fncachestore(path, openertype, encode)
457 return fncachestore(path, openertype, 'dotencode' in requirements)
450 458 return encodedstore(path, openertype)
451 459 return basicstore(path, openertype)
General Comments 0
You need to be logged in to leave comments. Login now