D6430: rust-discovery: using from Python code

gracinet (Georges Racinet) phabricator at mercurial-scm.org
Wed Jun 12 14:17:45 EDT 2019


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

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)



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


More information about the Mercurial-devel mailing list