chg: add fchdirx as a utility function
As part of the series to support long socket paths, we need to use fchdir and
check its result in several places. Make it a utility function.
#require test-repo
$ cd "$TESTDIR"/..
New errors are not allowed. Warnings are strongly discouraged.
$ hg files "set:(**.py or **.txt) - tests/**" | sed 's|\\|/|g' |
> python contrib/check-config.py