# HG changeset patch # User Markus F.X.J. Oberhumer # Date 1149202423 25200 # Node ID 62ce297f214f87fc6b5e67cebc44e2c01b43d6e4 # Parent 482d3fb47d80693f929101f95944bf019009dd79 Expand '~' in path to extensions. diff --git a/doc/hgrc.5.txt b/doc/hgrc.5.txt --- a/doc/hgrc.5.txt +++ b/doc/hgrc.5.txt @@ -165,6 +165,14 @@ extensions:: the path to the ".py" file (including the file name extension) that defines the extension. + Example for ~/.hgrc: + + [extensions] + # (the mq extension will get loaded from mercurial's path) + hgext.mq = + # (this extension will get loaded from the file specified) + myfeature = ~/.hgext/myfeature.py + hooks:: Commands or Python functions that get automatically executed by various actions such as starting or finishing a commit. Multiple diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -142,7 +142,10 @@ class ui(object): yield parent def extensions(self): - return self.configitems("extensions") + ret = self.configitems("extensions") + for i, (k, v) in enumerate(ret): + if v: ret[i] = (k, os.path.expanduser(v)) + return ret def hgignorefiles(self): result = []