##// END OF EJS Templates
store: have custom init for entries class...
marmoute -
r51367:c37450a5 default
parent child Browse files
Show More
@@ -453,7 +453,7 b' FILETYPE_FILELOG_OTHER = FILEFLAGS_FILEL'
453 453 FILETYPE_OTHER = FILEFLAGS_OTHER
454 454
455 455
456 @attr.s(slots=True)
456 @attr.s(slots=True, init=False)
457 457 class BaseStoreEntry:
458 458 """An entry in the store
459 459
@@ -463,6 +463,16 b' class BaseStoreEntry:'
463 463 is_volatile = attr.ib(default=False)
464 464 file_size = attr.ib(default=None)
465 465
466 def __init__(
467 self,
468 unencoded_path,
469 is_volatile=False,
470 file_size=None,
471 ):
472 self.unencoded_path = unencoded_path
473 self.is_volatile = is_volatile
474 self.file_size = file_size
475
466 476 def files(self):
467 477 return [
468 478 StoreFile(
@@ -473,14 +483,14 b' class BaseStoreEntry:'
473 483 ]
474 484
475 485
476 @attr.s(slots=True)
486 @attr.s(slots=True, init=False)
477 487 class SimpleStoreEntry(BaseStoreEntry):
478 488 """A generic entry in the store"""
479 489
480 490 is_revlog = False
481 491
482 492
483 @attr.s(slots=True)
493 @attr.s(slots=True, init=False)
484 494 class RevlogStoreEntry(BaseStoreEntry):
485 495 """A revlog entry in the store"""
486 496
@@ -488,6 +498,22 b' class RevlogStoreEntry(BaseStoreEntry):'
488 498 revlog_type = attr.ib(default=None)
489 499 is_revlog_main = attr.ib(default=None)
490 500
501 def __init__(
502 self,
503 unencoded_path,
504 revlog_type,
505 is_revlog_main=False,
506 is_volatile=False,
507 file_size=None,
508 ):
509 super().__init__(
510 unencoded_path=unencoded_path,
511 is_volatile=is_volatile,
512 file_size=file_size,
513 )
514 self.revlog_type = revlog_type
515 self.is_revlog_main = is_revlog_main
516
491 517
492 518 @attr.s(slots=True)
493 519 class StoreFile:
General Comments 0
You need to be logged in to leave comments. Login now