Patchwork [2,of,2] blackbox: fix blackbox causing exceptions in tests

mail settings
Submitter Durham Goode
Date May 23, 2013, 12:43 a.m.
Message ID <>
Download mbox | patch
Permalink /patch/1662/
State Superseded
Commit 6d6f148cada9677f0737517a071eebdf769b8f4b
Headers show


Durham Goode - May 23, 2013, 12:43 a.m.
# HG changeset patch
# User Durham Goode <>
# Date 1369269504 25200
#      Wed May 22 17:38:24 2013 -0700
# Node ID 93974b60ce3a20e57c6fbf33878cd1ac1097ced5
# Parent  1471b27a550d3735bc6f8e0676718266ca2350d3
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.


diff --git a/hgext/ b/hgext/
--- a/hgext/
+++ b/hgext/
@@ -126,7 +126,8 @@ 
     if not repo.local():
-    ui.setrepo(repo)
+    if util.safehasattr(ui, 'setrepo'):
+        ui.setrepo(repo)
     [('l', 'limit', 10, _('the number of events to show')),