changeset 19230:6d6f148cada9 stable

blackbox: fix blackbox causing exceptions in tests In the tests some scripts call reposetup with the base ui instead of the one the extensions have modified. This causes an exception in blackbox.reposetup since it expected a method to be there. So I just check for it first. This only happened when the blackbox extension was enabled during tests.
author Durham Goode <durham@fb.com>
date Wed, 22 May 2013 17:38:24 -0700
parents 41e39a0299cb
children b592fd33233a
files hgext/blackbox.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/blackbox.py	Wed May 22 17:31:47 2013 -0700
+++ b/hgext/blackbox.py	Wed May 22 17:38:24 2013 -0700
@@ -126,7 +126,8 @@
     if not repo.local():
         return
 
-    ui.setrepo(repo)
+    if util.safehasattr(ui, 'setrepo'):
+        ui.setrepo(repo)
 
 @command('^blackbox',
     [('l', 'limit', 10, _('the number of events to show')),