topic: wrap makebundlerepository() to wrap bundlerepository class (issue6856)
Previously we just tried to wrap bundlerepo.bundlerepository class globally, but it looks like in some situations it leads to an infinite recursion or similar issues. This patch tries to fix this by moving the class-wrapping logic inside a function that is used for creating bundlerepository.