tests/hghaveaddon.py
author Martin von Zweigbergk <martinvonz@google.com>
Wed, 25 Jul 2018 16:23:25 -0700
changeset 3905 4806d1339c30
parent 2959 ef361938dfa1
permissions -rw-r--r--
builddependencies: share code between single- and multi-successor cases The two cases now have more similar structure ("if succ in revs: dependencies[r].add(succ)"), so let's share the code so it doesn't start drifting apart again.

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