ui: represent paths as classes...
ui: represent paths as classes
Many have long wanted for paths to have expanded functionality and
flexibility.
In order to make that transition possible, we need to start
representing paths as something more than simple strings.
This patch introduces two classes:
1) "path" for representing a single path instance
2) "paths" for representing a collection of "paths"
Since we don't like patches that introduce new code without any
consumers, we convert ui.expandpath() to use the new APIs internally.
Upcoming patches will start exposing "path" instances to consumers
that currently interface with string paths.
The new "paths" attribute of ui is populated from config data the first
time it is accessed. Since it isn't updated when the configs are
modified, this could lead to some inaccurate caching behavior. It
shouldn't be an issue, as paths information is typically not accessed
until command dispatch, which occurs after the repository config
and extensions have been loaded. Time will tell if we need to refresh
paths information when the underlying config changes.