comparison mercurial/extensions.py @ 28311:1b0ef07ba783

extensions: copy attributes to wrapper by wrapfunction() Before this patch, new partial function "wrap" had no useful docstring. It makes sense to copy __doc__ and __module__ as we do for wrapcommand().
author Yuya Nishihara <yuya@tcha.org>
date Sat, 09 Jan 2016 19:52:55 +0900
parents 01dc11e7191f
children 24f1d3c70c41
comparison
equal deleted inserted replaced
28310:01dc11e7191f 28311:1b0ef07ba783
284 ''' 284 '''
285 assert callable(wrapper) 285 assert callable(wrapper)
286 286
287 origfn = getattr(container, funcname) 287 origfn = getattr(container, funcname)
288 assert callable(origfn) 288 assert callable(origfn)
289 setattr(container, funcname, bind(wrapper, origfn)) 289 wrap = bind(wrapper, origfn)
290 _updatewrapper(wrap, origfn)
291 setattr(container, funcname, wrap)
290 return origfn 292 return origfn
291 293
292 def _disabledpaths(strip_init=False): 294 def _disabledpaths(strip_init=False):
293 '''find paths of disabled extensions. returns a dict of {name: path} 295 '''find paths of disabled extensions. returns a dict of {name: path}
294 removes /__init__.py from packages if strip_init is True''' 296 removes /__init__.py from packages if strip_init is True'''