Patchwork D2643: setdiscovery: back out changeset 5cfdf6137af8 (issue5809)

login
register
mail settings
Submitter phabricator
Date March 4, 2018, 7:29 p.m.
Message ID <e9d87f5833456f4e0a6ea828cad30fe3@localhost.localdomain>
Download mbox | patch
Permalink /patch/28970/
State Not Applicable
Headers show

Comments

phabricator - March 4, 2018, 7:29 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG613954a17a25: setdiscovery: back out changeset 5cfdf6137af8 (issue5809) (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2643?vs=6555&id=6593

REVISION DETAIL
  https://phab.mercurial-scm.org/D2643

AFFECTED FILES
  mercurial/discovery.py
  mercurial/setdiscovery.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers, indygreg
Cc: mercurial-devel

Patch

diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py
--- a/mercurial/setdiscovery.py
+++ b/mercurial/setdiscovery.py
@@ -130,7 +130,7 @@ 
         sample = set(random.sample(sample, desiredlen))
     return sample
 
-def findcommonheads(ui, local, remote, heads=None,
+def findcommonheads(ui, local, remote,
                     initialsamplesize=100,
                     fullsamplesize=200,
                     abortwhenunrelated=True,
@@ -155,15 +155,11 @@ 
     sample = _limitsample(ownheads, initialsamplesize)
     # indices between sample and externalized version must match
     sample = list(sample)
-    if heads:
-        srvheadhashes = heads
-        yesno = remote.known(dag.externalizeall(sample))
-    else:
-        batch = remote.iterbatch()
-        batch.heads()
-        batch.known(dag.externalizeall(sample))
-        batch.submit()
-        srvheadhashes, yesno = batch.results()
+    batch = remote.iterbatch()
+    batch.heads()
+    batch.known(dag.externalizeall(sample))
+    batch.submit()
+    srvheadhashes, yesno = batch.results()
 
     if cl.tip() == nullid:
         if srvheadhashes != [nullid]:
diff --git a/mercurial/discovery.py b/mercurial/discovery.py
--- a/mercurial/discovery.py
+++ b/mercurial/discovery.py
@@ -57,7 +57,7 @@ 
         if all(knownnode(h) for h in heads):
             return (heads, False, heads)
 
-    res = setdiscovery.findcommonheads(repo.ui, repo, remote, heads,
+    res = setdiscovery.findcommonheads(repo.ui, repo, remote,
                                        abortwhenunrelated=not force,
                                        ancestorsof=ancestorsof)
     common, anyinc, srvheads = res