Commits

Pierre-Yves David  committed 9555231

hgweb: disable branchtip filtering for hgweb

hgweb make extensibe use of branchtip we should.

- Our branchtip wrapping make the function expensive, killing performance.
- We do not filter anything un hgweb yet.

  • Participants
  • Parent commits 63fd2a6
  • Branches stable

Comments (0)

Files changed (1)

File hgext/evolve.py

 from mercurial.commands import walkopts, commitopts, commitopts2
 from mercurial.node import nullid
 
+import mercurial.hgweb.hgweb_mod
+
 
 
 # This extension contains the following code
 @eh.wrapfunction(localrepo.localrepository, 'branchtip')
 def obsbranchtip(orig, repo, branch):
     """ensure "stable" reference does not end on a hidden changeset"""
+    if not getattr(repo, '_dofilterbranchtip', True):
+        return orig(repo, branch)
     result = ()
     heads = repo.branchmap().get(branch, ())
     if heads:
     return result[0].node()
 
 
+@eh.wrapfunction(mercurial.hgweb.hgweb_mod.hgweb, '__init__')
+@eh.wrapfunction(mercurial.hgweb.hgweb_mod.hgweb, 'refresh')
+def nofilter(orig, hgweb, *args, **kwargs):
+    orig(hgweb, *args, **kwargs)
+    hgweb.repo._dofilterbranchtip = False
+
+
 #####################################################################
 ### Additional Utilities                                          ###
 #####################################################################