bundlerepo: remove old style check of file names
The old check is no longer needed:
The checked paths will be passed on to filelog.__init__ which will prefix the
path with 'data/'. A leading '/' will thus not do any harm.
And: The paths will be used by an opener which will use a pathauditor.
And finally: The old check did not consider Windows paths and was thus
insufficient.
bundlerepo: use revlog._checkhash
The error message will mention datafile instead of indexfile.
bundlerepo: store validated deltabase rev in basemap instead of node
This avoids some lookups and aligns bundlerepo more with what revlog do.
bundlerepo: use rev instead of node for iteration in revision()
Avoids some lookups and avoids using rev while iterating.
bundlerepo: inline inbundle()
It didn't make it faster, it didn't make the code smaller, it didn't make the
code simpler.
-1 is never in basemap.
bundlerepo: improve performance for bundle() revset expression
Create the set of revision numbers directly instead of creating a list of nodes
first.
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.