tests/hghaveaddon.py
author Pulkit Goyal <7895pulkit@gmail.com>
Mon, 19 Mar 2018 13:11:55 +0530
changeset 3572 7934e9751d69
parent 2959 ef361938dfa1
permissions -rw-r--r--
state: add __setitem__() for cmdstate class Adding __setitem__() will help us in setting the value of variables stored in state files using `state[key] = value` in our code which is very convenient.

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