# HG changeset patch # User Pierre-Yves David # Date 1457689692 0 # Node ID 5ef77a1d975c81cb650d5166fd322a552e839a9d # Parent a3da15803b7a459d59f42c57661f9ef8d2c6325c hgext: turn 'hgext' into a namespace package Actually since Python 2.3, there is some way to turn top level package into "namespace package" so that multiple subpackage installed in different part of the path can still be imported transparently. This feature was previously thought (at least by myself) to be only provided by some setuptool black magic. Turning hgext into such namespace package allows third extensions to install themselves inside the "hgext" namespace package to avoid polluting the global python module namespace. They will now be able to do so without making it a pain to use a Mercurial "installed" in a different way/location than these extensions. diff -r a3da15803b7a -r 5ef77a1d975c hgext/__init__.py --- a/hgext/__init__.py Thu Feb 25 13:18:36 2016 +0100 +++ b/hgext/__init__.py Fri Mar 11 09:48:12 2016 +0000 @@ -1,1 +1,4 @@ -# Copyright 2011 Logilab SA +from __future__ import absolute_import +import pkgutil +__path__ = pkgutil.extend_path(__path__, __name__) +