phases: check secret presence the right way during discovery
There is an official function for this, lets use it.
This will prevent the code to break in the future while we refactor the phase
code.
--- a/mercurial/discovery.py Tue Feb 20 14:21:18 2024 +0100
+++ b/mercurial/discovery.py Tue Feb 20 17:17:54 2024 +0100
@@ -168,7 +168,7 @@
og.commonheads, _any, _hds = commoninc
# compute outgoing
- mayexclude = repo._phasecache.phaseroots[phases.secret] or repo.obsstore
+ mayexclude = phases.hassecret(repo) or repo.obsstore
if not mayexclude:
og.ancestorsof = onlyheads or repo.heads()
elif onlyheads is None: