changeset 5200:a60a478ee2fa stable

obsdiscovery: avoid considering locally hidden changeset This looks like a dubious optimisation
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 06 Mar 2020 02:41:53 +0100
parents 3302e4e742bc
children 7c6d08cd1221
files hgext3rd/evolve/obsdiscovery.py tests/test-discovery-hidden-common.t
diffstat 2 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/obsdiscovery.py	Wed Mar 11 18:29:46 2020 +0100
+++ b/hgext3rd/evolve/obsdiscovery.py	Fri Mar 06 02:41:53 2020 +0100
@@ -844,7 +844,12 @@
     repo = pullop.repo
     remote = pullop.remote
     unfi = repo.unfiltered()
-    revs = unfi.revs(b'::(%ln - null)', pullop.common)
+    # Also exclude filtered revisions. Working on unfiltered repository can
+    # give a bit more precise view of the repository. However it makes the
+    # overall operation more complicated.
+    filteredrevs = repo.changelog.filteredrevs
+    # XXX probably not very efficient
+    revs = unfi.revs(b'::(%ln - null) - %ld', pullop.common, filteredrevs)
     boundaries = {b'heads': pullop.pulledsubset}
     if not revs: # nothing common
         boundaries[b'common'] = [node.nullid]
@@ -859,8 +864,8 @@
     if bundle2 and _canobshashrange(repo, remote):
         obsexcmsg(repo.ui, b"looking for common markers in %i nodes\n"
                   % len(revs))
-        boundaries[b'missing'] = findmissingrange(repo.ui, unfi, pullop.remote,
-                                                  revs)
+        missing = findmissingrange(repo.ui, repo, pullop.remote, revs)
+        boundaries[b'missing'] = missing
     else:
         boundaries[b'common'] = [node.nullid]
     return boundaries
--- a/tests/test-discovery-hidden-common.t	Wed Mar 11 18:29:46 2020 +0100
+++ b/tests/test-discovery-hidden-common.t	Fri Mar 06 02:41:53 2020 +0100
@@ -87,7 +87,7 @@
   $ hg -R ../client pull
   pulling from ssh://user@dummy/server
   searching for changes
-  OBSEXC: looking for common markers in 2 nodes
+  OBSEXC: looking for common markers in 1 nodes
   adding changesets
   adding manifests
   adding file changes