Patchwork D6430: rust-discovery: using from Python code

login
register
mail settings
Submitter phabricator
Date June 12, 2019, 6:17 p.m.
Message ID <fe10fb649ce8ba02b32ff04202f3c5f5@localhost.localdomain>
Download mbox | patch
Permalink /patch/40461/
State Not Applicable
Headers show

Comments

phabricator - June 12, 2019, 6:17 p.m.
gracinet edited the summary of this revision.
gracinet updated this revision to Diff 15473.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6430?vs=15230&id=15473

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6430/new/

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

AFFECTED FILES
  mercurial/setdiscovery.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py
--- a/mercurial/setdiscovery.py
+++ b/mercurial/setdiscovery.py
@@ -46,6 +46,11 @@ 
 import random
 
 from .i18n import _
+try:
+    from .rustext import discovery as rustdisco
+except ImportError:
+    rustdisco = None
+
 from .node import (
     nullid,
     nullrev,
@@ -390,6 +395,8 @@ 
 
     # full blown discovery
 
+    if rustdisco is not None:
+        partialdiscovery = rustdisco.PartialDiscovery
     randomize = ui.configbool('devel', 'discovery.randomize')
     disco = partialdiscovery(local, ownheads, remote.limitedarguments,
                              randomize=randomize)