comparison hgext/blackbox.py @ 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 27013ace80eb
children 7cc77030c557
comparison
equal deleted inserted replaced
19229:41e39a0299cb 19230:6d6f148cada9
124 # It doesn't have a .hg directory to put a blackbox in, so we don't do 124 # It doesn't have a .hg directory to put a blackbox in, so we don't do
125 # the blackbox setup for it. 125 # the blackbox setup for it.
126 if not repo.local(): 126 if not repo.local():
127 return 127 return
128 128
129 ui.setrepo(repo) 129 if util.safehasattr(ui, 'setrepo'):
130 ui.setrepo(repo)
130 131
131 @command('^blackbox', 132 @command('^blackbox',
132 [('l', 'limit', 10, _('the number of events to show')), 133 [('l', 'limit', 10, _('the number of events to show')),
133 ], 134 ],
134 _('hg blackbox [OPTION]...')) 135 _('hg blackbox [OPTION]...'))