[PATCH 17 of 22 V2-Series-D] hgweb: protect filelog revnav from filtering related crash

Kevin Bullock kbullock+mercurial at ringworld.org
Mon Jan 14 21:20:07 UTC 2013


On Jan 14, 2013, at 2:35 PM, Pierre-Yves David wrote:

> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at logilab.fr>
> # Date 1357843043 -3600
> # Node ID 4725c0dc4949c12016abf6d9c60806defa6404e6
> # Parent  744fd7971957a6539a1627dfed487052f2f0bc25
> hgweb: protect filelog revnav from filtering related crash
> 
> As explained in 518c1403838f linkrev is broken with filtering. This changeset
> use an unfiltered repo to retrieve any node from a link rev.
> 
> Like the previous changesets and 518c1403838f, This will prevent traceback on
> filtered repository. This changeset result in an incorrect behaviors, Navigation
> link may point to missing revision. However this bad navigation
> generation is much better than a plain crash
> 
> diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py
> --- a/mercurial/hgweb/webutil.py
> +++ b/mercurial/hgweb/webutil.py
> @@ -109,11 +109,11 @@ class filerevnav(revnav):
> 
>         :repo: repo object we generate nav for
>         :path: path of the file we generate nav for
>         """
>         # used for iteration
> -        self._hl = repo.changelog
> +        self._hl = repo.unfiltered().changelog

Why didn't we initialize it to the unfiltered changelog to begin with? This property was only introduced N changesets ago, where N < 5.

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock




More information about the Mercurial-devel mailing list