Patchwork D1166: ui: move request exit handlers to global state

login
register
mail settings
Submitter phabricator
Date Oct. 18, 2017, 8:27 p.m.
Message ID <68c81152e912e62b145fba761adc65cf@localhost.localdomain>
Download mbox | patch
Permalink /patch/25206/
State Not Applicable
Headers show

Comments

phabricator - Oct. 18, 2017, 8:27 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG2bcf27922651: ui: move request exit handlers to global state (authored by singhsrb, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1166?vs=2943&id=2994

REVISION DETAIL
  https://phab.mercurial-scm.org/D1166

AFFECTED FILES
  mercurial/ui.py

CHANGE DETAILS




To: singhsrb, #hg-reviewers, quark, durin42
Cc: quark, mercurial-devel

Patch

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -183,6 +183,9 @@ 
 # retrieving configuration value.
 _unset = object()
 
+# _reqexithandlers: callbacks run at the end of a request
+_reqexithandlers = []
+
 class ui(object):
     def __init__(self, src=None):
         """Create a fresh new ui object if no src given
@@ -193,8 +196,6 @@ 
         """
         # _buffers: used for temporary capture of output
         self._buffers = []
-        # _exithandlers: callbacks run at the end of a request
-        self._exithandlers = []
         # 3-tuple describing how each buffer in the stack behaves.
         # Values are (capture stderr, capture subprocesses, apply labels).
         self._bufferstates = []
@@ -220,7 +221,6 @@ 
         self._styles = {}
 
         if src:
-            self._exithandlers = src._exithandlers
             self.fout = src.fout
             self.ferr = src.ferr
             self.fin = src.fin
@@ -1098,6 +1098,10 @@ 
 
         return True
 
+    @property
+    def _exithandlers(self):
+        return _reqexithandlers
+
     def atexit(self, func, *args, **kwargs):
         '''register a function to run after dispatching a request