[PATCH 1 of 3] extensions: introduce a class interposition function

Pierre-Yves David pierre-yves.david at logilab.fr
Wed Nov 21 03:29:19 CST 2012


On Tue, Nov 20, 2012 at 02:55:43PM -0800, Bryan O'Sullivan wrote:
> # HG changeset patch
> # User Bryan O'Sullivan <bryano at fb.com>
> # Date 1353452136 28800
> # Node ID cbf274dc847b5c28a282ae98a7d8b9bd48b6137d
> # Parent  4ae21a7568f353dcb781df28d2acf458b06afcad
> extensions: introduce a class interposition function
> 
> This allows an existing class to be augmented in a transparent way,
> without its subclasses or callers needing to participate.
> 
> The manual class override mechanism currently in use introduces
> names into an outer scope that can be accidentally (and incorrectly)
> used in monkeypatched classes. It also does not make clear which
> class is intended to be monkeypatched. Finally, it requires explicit
> support from the to-be-monkeypatched code (e.g. reposetup).

I'm a afraid this will result in side effect when multiple repository are
involved. FUJIWARA Katsunori spend a lot of time ensuring that enabling and
extension in one repo won't affect other repository involved in the same
process.

(But cleaning up the wrapping is a good idea)

-- 
Pierre-Yves David

http://www.logilab.fr/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20121121/8678aaf0/attachment.pgp>


More information about the Mercurial-devel mailing list