changeset 3647:626c5fa0ef07

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).
author Anton Shestakov <av6@dwimlabs.net>
date Fri, 06 Apr 2018 14:37:22 +0800
parents 0dd393a32567
children ca9fd36b4528
files hgext3rd/evolve/safeguard.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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")