This should be faster and more future-proof. Calls where the result is to be
sorted using util.sort() have been left unchanged. Calls to .items() on
configparser objects have been left as-is, too.
relglob: and relre: were already detected for a long time, so
I kept this undocumented functionality, especially as it was already
tested in test-hgignore.