# HG changeset patch # User Anton Shestakov # Date 1522996642 -28800 # Node ID 626c5fa0ef07f2cc92f2a780e277b7fbfb078aeb # Parent 0dd393a32567ead292ec38d602ada44747f906cf safeguard: use self instead of repo in noautopublishrepo.checkpush() Referring to repo here was somehow preventing it from being garbage-collected (important in hgweb, where currently every request gets a new repo). diff -r 0dd393a32567 -r 626c5fa0ef07 hgext3rd/evolve/safeguard.py --- a/hgext3rd/evolve/safeguard.py Fri Apr 06 14:36:36 2018 +0800 +++ b/hgext3rd/evolve/safeguard.py Fri Apr 06 14:37:22 2018 +0800 @@ -25,17 +25,17 @@ def checkpush(self, pushop): super(noautopublishrepo, self).checkpush(pushop) - behavior = repo.ui.config('experimental', 'auto-publish', 'default') + behavior = self.ui.config('experimental', 'auto-publish', 'default') remotephases = pushop.remote.listkeys('phases') publishing = remotephases.get('publishing', False) if behavior in ('warn', 'abort') and publishing: if pushop.revs is None: - published = repo.filtered('served').revs("not public()") + published = self.filtered('served').revs("not public()") else: - published = repo.revs("::%ln - public()", pushop.revs) + published = self.revs("::%ln - public()", pushop.revs) if published: if behavior == 'warn': - repo.ui.warn(_('%i changesets about to be published\n') % len(published)) + self.ui.warn(_('%i changesets about to be published\n') % len(published)) elif behavior == 'abort': msg = _('push would publish 1 changesets') hint = _("behavior controlled by 'experimental.auto-publish' config")