Skip to content
Snippets Groups Projects
Commit 5360f8ad authored by Georges Racinet's avatar Georges Racinet
Browse files

branch: filtering obsolete heads

Same thing that our current hg-git conversion does, *but* this
is known to have performance issues on large repositories. Putting
this on a call path that the client has every right to think is cheap
is very problematic.

I would prefer a simple rule that Heptapod never exposes any obsolete
head in its branch queries. The rationale for that would be that
by definition Git does not either present any unreachable commit.

For the time being (Heptapod 0.17), the projects backed by HGitaly are
highly experimental, so we can probably live with it.
parent 3a01705d
No related branches found
No related tags found
1 merge request!15Using NOT_FOUND only if repository is not found
Pipeline #12870 passed with warnings
......@@ -9,6 +9,7 @@
node as nodemod,
pycompat,
)
from hgext3rd.evolve import headchecking
from heptapod.gitlab.branch import (
branchmap_branch_from_gitlab_branch,
gitlab_branch_from_branchmap_branch,
......@@ -32,7 +33,9 @@
:class:`changectx` instances.
"""
# branchmap entries results are already sorted by increasing rev number
contexts = (repo[node] for node in entry)
revs = [repo[node].rev() for node in entry]
contexts = (repo[rev]
for rev in headchecking._filter_obsolete_heads(repo, revs))
visible = [c for c in contexts if not (c.closesbranch() or c.bookmarks())]
if not visible and avoid_bookmark_shadowing:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment