Show More
@@ -70,6 +70,7 b' comment associated with each format for ' | |||
|
70 | 70 | |
|
71 | 71 | import binascii |
|
72 | 72 | import struct |
|
73 | import weakref | |
|
73 | 74 | |
|
74 | 75 | from .i18n import _ |
|
75 | 76 | from .pycompat import getattr |
@@ -561,10 +562,18 b' class obsstore:' | |||
|
561 | 562 | # caches for various obsolescence related cache |
|
562 | 563 | self.caches = {} |
|
563 | 564 | self.svfs = svfs |
|
564 | self.repo = repo | |
|
565 | self._repo = weakref.ref(repo) | |
|
565 | 566 | self._defaultformat = defaultformat |
|
566 | 567 | self._readonly = readonly |
|
567 | 568 | |
|
569 | @property | |
|
570 | def repo(self): | |
|
571 | r = self._repo() | |
|
572 | if r is None: | |
|
573 | msg = "using the obsstore of a deallocated repo" | |
|
574 | raise error.ProgrammingError(msg) | |
|
575 | return r | |
|
576 | ||
|
568 | 577 | def __iter__(self): |
|
569 | 578 | return iter(self._all) |
|
570 | 579 |
General Comments 0
You need to be logged in to leave comments.
Login now