Patchwork [21,of,23,Series-D] hgweb: ignore filtered revision in revnav

login
register
mail settings
Submitter Pierre-Yves David
Date Jan. 11, 2013, 12:24 a.m.
Message ID <09f2069e0b9e51d35b07.1357863846@yamac.lan>
Download mbox | patch
Permalink /patch/552/
State Superseded
Headers show

Comments

Pierre-Yves David - Jan. 11, 2013, 12:24 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@logilab.fr>
# Date 1357842863 -3600
# Node ID 09f2069e0b9e51d35b07726b0c38b83b52835377
# Parent  d497c3c174cf762c0852fd445a3509c908695fdf
hgweb: ignore filtered revision in revnav

This changeset checks that a revision is known before adding it to the
navigation.

This will prevent traceback on filtered repository. This changeset result in an
incorrect behaviors, Navigation link may be dropped without any replacement.
However this bad navigation generation is much better than a crash

Patch

diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/webutil.py
+++ b/mercurial/hgweb/webutil.py
@@ -86,10 +86,12 @@  class revnav(object):
         targets.sort()
 
         navbefore = [("(0)", self.hex(0))]
         navafter = []
         for rev in targets:
+            if rev not in self.cl:
+                continue
             if pos < rev < limit:
                 navafter.append(("+%d" % f, self.hex(rev)))
             if 0 < rev < pos:
                 navbefore.append(("-%d" % f, self.hex(rev)))