diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -53,6 +53,12 @@ stringutil, ) +try: + from . import rustext + rustext.__name__ # force actual import (see hgdemandimport) +except ImportError: + rustext = None + base85 = policy.importmod(r'base85') osutil = policy.importmod(r'osutil') parsers = policy.importmod(r'parsers') @@ -3204,6 +3210,9 @@ if safehasattr(parsers, 'dirs'): dirs = parsers.dirs +if rustext is not None: + dirs = rustext.dirstate.Dirs + def finddirs(path): pos = path.rfind('/') while pos != -1: