Try to pass repo.ui to reposetup hooks
The ui object we received in this function may belong to another repo,
which could be confusing from the hook point of view. Trying to use
the ui object from the newly created repo should avoid this confusion.
transplant: remote bundle source was not closed before deleting the fetched bundle.
It fails under win32 because "normal" opened files cannot be removed.
Handle functions as the value of a hooks.<name> config variable
This should make it easier for extensions to add a hook when
they're loaded.
setup.py: reload __version__.py after writing it.
write_version loads __version__.py before writing it (see
7eb694a1c1af),
so we have to explicitly reload it to use the correct version.
Problem diagnosed by Christian Ebert.