Mercurial > evolve
annotate tests/hghaveaddon.py @ 5480:9242d0b5f74d stable
split: compatibility with cmdutil.revert() without parents argument
`assert` is here because I'm not sure if this is enough, and we might not have
tests that fail this specific assert.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Fri, 21 Aug 2020 23:04:03 +0800 |
parents | 398c7031177a |
children | f2139537c2be |
rev | line source |
---|---|
2959
ef361938dfa1
doc: integrate graphviz graphs in tutorials
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
1 import hghave |
ef361938dfa1
doc: integrate graphviz graphs in tutorials
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
2 |
ef361938dfa1
doc: integrate graphviz graphs in tutorials
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
3 @hghave.check("docgraph-ext", "Extension to generate graph from repository") |
ef361938dfa1
doc: integrate graphviz graphs in tutorials
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
4 def docgraph(): |
ef361938dfa1
doc: integrate graphviz graphs in tutorials
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
5 try: |
ef361938dfa1
doc: integrate graphviz graphs in tutorials
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
6 import hgext.docgraph |
ef361938dfa1
doc: integrate graphviz graphs in tutorials
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
7 hgext.docgraph.cmdtable # trigger import |
ef361938dfa1
doc: integrate graphviz graphs in tutorials
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
8 except ImportError: |
ef361938dfa1
doc: integrate graphviz graphs in tutorials
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
9 try: |
ef361938dfa1
doc: integrate graphviz graphs in tutorials
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
10 import hgext3rd.docgraph |
ef361938dfa1
doc: integrate graphviz graphs in tutorials
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
11 hgext3rd.docgraph.cmdtable # trigger import |
ef361938dfa1
doc: integrate graphviz graphs in tutorials
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
12 except ImportError: |
ef361938dfa1
doc: integrate graphviz graphs in tutorials
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
13 return False |
ef361938dfa1
doc: integrate graphviz graphs in tutorials
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
14 return True |
5362
398c7031177a
tests: use hghaveaddon.py to check for flake8
Anton Shestakov <av6@dwimlabs.net>
parents:
2959
diff
changeset
|
15 |
398c7031177a
tests: use hghaveaddon.py to check for flake8
Anton Shestakov <av6@dwimlabs.net>
parents:
2959
diff
changeset
|
16 @hghave.check("flake8", "Flake8 python linter") |
398c7031177a
tests: use hghaveaddon.py to check for flake8
Anton Shestakov <av6@dwimlabs.net>
parents:
2959
diff
changeset
|
17 def has_flake8(): |
398c7031177a
tests: use hghaveaddon.py to check for flake8
Anton Shestakov <av6@dwimlabs.net>
parents:
2959
diff
changeset
|
18 try: |
398c7031177a
tests: use hghaveaddon.py to check for flake8
Anton Shestakov <av6@dwimlabs.net>
parents:
2959
diff
changeset
|
19 import flake8 |
398c7031177a
tests: use hghaveaddon.py to check for flake8
Anton Shestakov <av6@dwimlabs.net>
parents:
2959
diff
changeset
|
20 |
398c7031177a
tests: use hghaveaddon.py to check for flake8
Anton Shestakov <av6@dwimlabs.net>
parents:
2959
diff
changeset
|
21 flake8.__version__ |
398c7031177a
tests: use hghaveaddon.py to check for flake8
Anton Shestakov <av6@dwimlabs.net>
parents:
2959
diff
changeset
|
22 except ImportError: |
398c7031177a
tests: use hghaveaddon.py to check for flake8
Anton Shestakov <av6@dwimlabs.net>
parents:
2959
diff
changeset
|
23 return False |
398c7031177a
tests: use hghaveaddon.py to check for flake8
Anton Shestakov <av6@dwimlabs.net>
parents:
2959
diff
changeset
|
24 else: |
398c7031177a
tests: use hghaveaddon.py to check for flake8
Anton Shestakov <av6@dwimlabs.net>
parents:
2959
diff
changeset
|
25 return True |