diff mercurial/localrepo.py @ 24250:9c32eea2ca04

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.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 07 Feb 2015 12:42:10 -0800
parents 7977d35df13b
children e9ede9b4c2f8
line wrap: on
line diff