[trivial][merge] unbreak benchmarks

John Arbash Meinel john at arbash-meinel.com
Tue Apr 17 20:36:40 BST 2007


Martin Pool wrote:
> This code depended on some other modules already being loaded, and
> breaks the benchmarks in bzr.dev:
> 
> # Bazaar revision bundle v0.9
> #
> # message:
> #   fix import order dependency that broke benchmarks
> # committer: Martin Pool <mbp at sourcefrog.net>
> # date: Tue 2007-04-17 16:51:02.299999952 +1000
> 

It looks like you are using tabs instead of whitespace. -1 on that.
(though the test suite should catch your mistake for you)


> === modified file bzrlib/tests/__init__.py
> --- bzrlib/tests/__init__.py
> +++ bzrlib/tests/__init__.py
> @@ -751,10 +751,15 @@
>         self._startLogFile()
>         self._benchcalls = []
>         self._benchtime = None
> +        self._clear_hooks()
> +
> +    def _clear_hooks(self):
>         # prevent hooks affecting tests
> +        import bzrlib.branch
> +        import bzrlib.smart.server
>         self._preserved_hooks = {
> -            bzrlib.branch.Branch:bzrlib.branch.Branch.hooks,
> -           
> bzrlib.smart.server.SmartTCPServer:bzrlib.smart.server.SmartTCPServer.hooks,
> 
> +            bzrlib.branch.Branch: bzrlib.branch.Branch.hooks,
> +            bzrlib.smart.server.SmartTCPServer:
> bzrlib.smart.server.SmartTCPServer.hooks,
>             }
>         self.addCleanup(self._restoreHooks)
>         # this list of hooks must be kept in sync with the defaults
> 

John
=:->




More information about the bazaar mailing list