view tests/hghaveaddon.py @ 5608:d9ee2706487f stable

compat: add support for upstream rename of merge.update() to _update() The function was renamed in Mercurial commit 2c86b9587740.
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 25 Sep 2020 09:13:57 -0700
parents 398c7031177a
children f2139537c2be
line wrap: on
line source

import hghave

@hghave.check("docgraph-ext", "Extension to generate graph from repository")
def docgraph():
    try:
        import hgext.docgraph
        hgext.docgraph.cmdtable # trigger import
    except ImportError:
        try:
            import hgext3rd.docgraph
            hgext3rd.docgraph.cmdtable # trigger import
        except ImportError:
            return False
    return True

@hghave.check("flake8", "Flake8 python linter")
def has_flake8():
    try:
        import flake8

        flake8.__version__
    except ImportError:
        return False
    else:
        return True