Mercurial > public > mercurial-scm > hg
diff tests/test-extdiff.t @ 52019:d1b54c152673
extdiff: don't run gui programs when in a cli-only environment
In order to provide a useful error message to override the behavior, we also
need to slightly change the way that tool.gui is found in the config. Before,
it had to be where tool.diffargs is located, which might not exist. Now,
tool.isgui can exist on its own.
A test is added for the new error message. We also need to force
procutil.isgui() to return true, so we set $DISPLAY to a non-empty value
before running any test expecting to have a gui.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Mon, 04 Feb 2019 23:32:20 -0800 |
parents | 7d908ee19b5b |
children | 31076a2301f1 |
line wrap: on
line diff
--- a/tests/test-extdiff.t Wed Dec 28 21:33:44 2022 -0800 +++ b/tests/test-extdiff.t Mon Feb 04 23:32:20 2019 -0800 @@ -158,9 +158,18 @@ diffing */extdiff.*/a.46c0e4daeb72/b a.81906f2b98ac/b (glob) (no-windows !) [1] +#if no-gui +Test gui tool error: + + $ hg --config extdiff.gui.alabalaf=True alabalaf + abort: tool 'alabalaf' requires a GUI + (to override, use: --config diff-tools.alabalaf.gui=False) + [255] +#endif + Test --per-file option for gui tool: - $ hg --config extdiff.gui.alabalaf=True alabalaf -c 6 --per-file --debug + $ DISPLAY=fake hg --config extdiff.gui.alabalaf=True alabalaf -c 6 --per-file --debug diffing */extdiff.*/a.46c0e4daeb72/* a.81906f2b98ac/* (glob) diffing */extdiff.*/a.46c0e4daeb72/* a.81906f2b98ac/* (glob) making snapshot of 2 files from rev 46c0e4daeb72 @@ -176,7 +185,7 @@ Test --per-file option for gui tool again: - $ hg --config merge-tools.alabalaf.gui=True alabalaf -c 6 --per-file --debug + $ DISPLAY=fake hg --config merge-tools.alabalaf.gui=True alabalaf -c 6 --per-file --debug diffing */extdiff.*/a.46c0e4daeb72/* a.81906f2b98ac/* (glob) diffing */extdiff.*/a.46c0e4daeb72/* a.81906f2b98ac/* (glob) making snapshot of 2 files from rev 46c0e4daeb72