bundlerepo: fix outdated comment
Comment was made invalid by
01ee43dda681.
hgweb: pass repo object to revnav construction
For compatibility with changelog filtering we need access to the changelog, a
simple nodefunc is not sufficient, only the changelog and repo have access the
filteredrevs information.
For the filerevnav version, we use an unfiltered changelog. Linkrev is currently
broken with filtering and we need some failsafe to prevent traceback. This is
the same approach as the one used in
518c1403838f. The use of
filectx.changectx() allowed the previous code to use the
518c1403838f hack.
This changeset may result in an incorrect behaviors, Navigation
link may point to missing revision. However this bad navigation
generation is much better than a plain crash
hgweb: introduction a filerevnav subclass
It'll be use to implement the file specific behavior.
hgweb: simplify the handling of empty repo
This abstraction have two advantages:
- If the revlog is empty, None of the code bellow is relevant,
early returns seems a win.
- Abtraction of the 'emptiness' check will help later when we stop relying on
nodefunc.
A bonus, with filtering, a non-empty revlog may not have '0' revision
accessible. It'll be easier to handle with the emptiness test in a dedicated
function
hgweb: move hex creation into an object method
This is clearer and allow later overwrite.
hgweb: pass nodefunc to the revnav object
The issue between hgweb and filtering lay in this function. Moving it into the
object itself helps to abstract the erroneous bit.
hgweb: move revnavgen into an object
For later compatibility with changelog filtering some part of the navigation
generation logic will be altered. Those altered part will be different when in
the changelog case and in the filelog case. Moving this into an object will
allow to use inheritance to override just the part of the logic we need.
The aimed logic are for example:
- generation of revision 'hex' (different logic for changelog and filelog)
- revlog emptyness test
- fetching of the first revision of a revlog (may not be 0)
hgweb: `limit` argument is actually `latestonly` renames and enforce
The `limit` argument of several generator have only two possible values in
practice: 0 and 1. We rename this parameter to `latestonly` and simplify it's
handling.
The simplification allows us to save fetching of data that we are sure to not
consume.
Having a function minimal function perimeter will helps future refactoring.
hgweb: add test regarding filtering and hgweb
Since
4d1671b39168 hgweb is broken with filtering. This changeset add test that
should pass once it is fixed. Test currently broken are commented and will be
uncommented by changeset that fix them.
The filelog test is currently passing because we already have some hack in core
regarding filelog (see
518c1403838f).