Show More
@@ -524,21 +524,7 b' class localrepository(object):' | |||||
524 |
|
524 | |||
525 | @storecache('obsstore') |
|
525 | @storecache('obsstore') | |
526 | def obsstore(self): |
|
526 | def obsstore(self): | |
527 | # read default format for new obsstore. |
|
527 | return obsolete.makestore(self.ui, self) | |
528 | # developer config: format.obsstore-version |
|
|||
529 | defaultformat = self.ui.configint('format', 'obsstore-version', None) |
|
|||
530 | # rely on obsstore class default when possible. |
|
|||
531 | kwargs = {} |
|
|||
532 | if defaultformat is not None: |
|
|||
533 | kwargs['defaultformat'] = defaultformat |
|
|||
534 | readonly = not obsolete.isenabled(self, obsolete.createmarkersopt) |
|
|||
535 | store = obsolete.obsstore(self.svfs, readonly=readonly, |
|
|||
536 | **kwargs) |
|
|||
537 | if store and readonly: |
|
|||
538 | self.ui.warn( |
|
|||
539 | _('obsolete feature not enabled but %i markers found!\n') |
|
|||
540 | % len(list(store))) |
|
|||
541 | return store |
|
|||
542 |
|
528 | |||
543 | @storecache('00changelog.i') |
|
529 | @storecache('00changelog.i') | |
544 | def changelog(self): |
|
530 | def changelog(self): |
@@ -753,6 +753,22 b' class obsstore(object):' | |||||
753 | seennodes |= pendingnodes |
|
753 | seennodes |= pendingnodes | |
754 | return seenmarkers |
|
754 | return seenmarkers | |
755 |
|
755 | |||
|
756 | def makestore(ui, repo): | |||
|
757 | """Create an obsstore instance from a repo.""" | |||
|
758 | # read default format for new obsstore. | |||
|
759 | # developer config: format.obsstore-version | |||
|
760 | defaultformat = ui.configint('format', 'obsstore-version', None) | |||
|
761 | # rely on obsstore class default when possible. | |||
|
762 | kwargs = {} | |||
|
763 | if defaultformat is not None: | |||
|
764 | kwargs['defaultformat'] = defaultformat | |||
|
765 | readonly = not isenabled(repo, createmarkersopt) | |||
|
766 | store = obsstore(repo.svfs, readonly=readonly, **kwargs) | |||
|
767 | if store and readonly: | |||
|
768 | ui.warn(_('obsolete feature not enabled but %i markers found!\n') | |||
|
769 | % len(list(store))) | |||
|
770 | return store | |||
|
771 | ||||
756 | def _filterprunes(markers): |
|
772 | def _filterprunes(markers): | |
757 | """return a set with no prune markers""" |
|
773 | """return a set with no prune markers""" | |
758 | return set(m for m in markers if m[1]) |
|
774 | return set(m for m in markers if m[1]) |
General Comments 0
You need to be logged in to leave comments.
Login now