changeset 1462:9c3ba42c582a

inhibit: move transaction wrapping outside of repo setup Before this patch, transaction wrapping code was done in reposetup. It happened to cause stackoverflows in repos with a lot of subreps. This patch moves the wrapping to extsetup and avoids this problem.
author Laurent Charignon <lcharignon@fb.com>
date Tue, 16 Jun 2015 10:07:51 -0700
parents 8ac1b7bd46ea
children 0c134ca37567
files hgext/inhibit.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/inhibit.py
+++ b/hgext/inhibit.py
@@ -48,9 +48,6 @@
             return newnode
 
     repo.__class__ = obsinhibitedrepo
-    # Wrapping this to inhibit obsolete revs resulting from a transaction
-    extensions.wrapfunction(localrepo.localrepository,
-                            'transaction', transactioncallback)
 
 def _update(orig, ui, repo, *args, **kwargs):
     """
@@ -199,6 +196,11 @@
     except KeyError:
         errormsg = _('Cannot use inhibit without the direct access extension')
         raise error.Abort(errormsg)
+
+    # Wrapping this to inhibit obsolete revs resulting from a transaction
+    extensions.wrapfunction(localrepo.localrepository,
+                            'transaction', transactioncallback)
+
     obsolete.cachefuncs['obsolete'] = _computeobsoleteset
     # wrap create marker to make it able to lift the inhibition
     extensions.wrapfunction(obsolete, 'createmarkers', _createmarkers)