extensions: extract function that copies function attributes to wrapper
wrapfunction() will be changed to copy these attributes. See the next patch
for details.
To run the tests, do:cd tests/python run-tests.pySee https://mercurial-scm.org/wiki/WritingTests formore information on writing tests.