debug-discovery: properly apply remote filtering in "old" mode
Before this change using `--remote-as-revs` with `--old` had no effect and
everything was considered as "common", which is really not what we intended.
--- a/mercurial/debugcommands.py Tue Jul 26 04:54:59 2022 +0200
+++ b/mercurial/debugcommands.py Tue Jul 26 04:56:29 2022 +0200
@@ -1276,6 +1276,9 @@
if not util.safehasattr(remote, b'branches'):
# enable in-client legacy support
remote = localrepo.locallegacypeer(remote.local())
+ if remote_revs:
+ r = remote._repo.filtered(b'debug-discovery-remote-filter')
+ remote._repo = r
common, _in, hds = treediscovery.findcommonincoming(
repo, remote, force=True, audit=data
)