hgext/evolve.py
branchstable
changeset 539 9555231a66b2
parent 534 45ccaba212f9
child 540 8c5da9e75ae0
--- a/hgext/evolve.py	Thu Aug 30 20:28:00 2012 +0200
+++ b/hgext/evolve.py	Thu Aug 30 21:47:09 2012 +0200
@@ -49,6 +49,8 @@
 from mercurial.commands import walkopts, commitopts, commitopts2
 from mercurial.node import nullid
 
+import mercurial.hgweb.hgweb_mod
+
 
 
 # This extension contains the following code
@@ -579,6 +581,8 @@
 @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:
@@ -588,6 +592,13 @@
     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                                          ###
 #####################################################################