tests/hghaveaddon.py
author Martin von Zweigbergk <martinvonz@google.com>
Fri, 15 Nov 2019 08:14:06 -0800
changeset 4941 c6fb901b7bc8
parent 2959 ef361938dfa1
permissions -rw-r--r--
cmdrewrite: avoid accessing scmutil.status fields by index Support for indexed access is going away in Mercurial. Accessing the fields by name is clearer anyway.

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