tests/hghaveaddon.py
author Martin von Zweigbergk <martinvonz@google.com>
Wed, 17 Jul 2019 11:45:37 -0700
changeset 4754 75307f276a79
parent 2959 ef361938dfa1
permissions -rw-r--r--
py3: make random topic name generation consistent across py2/py3 random.choice() (and others based on random.randint()) changed between py2 and py3 without a way to get the py2 behavior. However, random.random() did not change, so we can re-implement random.choice() based on that.

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