extdiff: refactor cmdline and gui calculation login in a separate fn
This is some good logic with handling of many config items and various ways of
specifying it. I want to reuse in `diff --tool` and hence refatcored it in a
separate function of it's own.
[tool.black]
line-length = 80
exclude = '''
build/
| wheelhouse/
| dist/
| packages/
| \.hg/
| \.mypy_cache/
| \.venv/
| mercurial/thirdparty/
'''
skip-string-normalization = true
quiet = true