##// END OF EJS Templates
obsstore: break the repo → obstore → repo loop...
marmoute -
r50319:360c156e default
parent child Browse files
Show More
@@ -70,6 +70,7 b' comment associated with each format for '
70
70
71 import binascii
71 import binascii
72 import struct
72 import struct
73 import weakref
73
74
74 from .i18n import _
75 from .i18n import _
75 from .pycompat import getattr
76 from .pycompat import getattr
@@ -561,10 +562,18 b' class obsstore:'
561 # caches for various obsolescence related cache
562 # caches for various obsolescence related cache
562 self.caches = {}
563 self.caches = {}
563 self.svfs = svfs
564 self.svfs = svfs
564 self.repo = repo
565 self._repo = weakref.ref(repo)
565 self._defaultformat = defaultformat
566 self._defaultformat = defaultformat
566 self._readonly = readonly
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 def __iter__(self):
577 def __iter__(self):
569 return iter(self._all)
578 return iter(self._all)
570
579
General Comments 0
You need to be logged in to leave comments. Login now