diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -953,7 +953,7 @@ class localrepository(object): or self.ui.configbool('devel', 'check-locks')): l = self._lockref and self._lockref() if l is None or not l.held: - scmutil.develwarn(self.ui, 'transaction with no lock') + self.ui.develwarn('transaction with no lock') tr = self.currenttransaction() if tr is not None: return tr.nest() @@ -1258,7 +1258,7 @@ class localrepository(object): or self.ui.configbool('devel', 'check-locks')): l = self._lockref and self._lockref() if l is not None and l.held: - scmutil.develwarn(self.ui, '"wlock" acquired after "lock"') + self.ui.develwarn('"wlock" acquired after "lock"') def unlock(): if self.dirstate.pendingparentchange(): diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -10,7 +10,7 @@ from mercurial.node import nullrev import util, error, osutil, revset, similar, encoding, phases import pathutil import match as matchmod -import os, errno, re, glob, tempfile, shutil, stat, inspect +import os, errno, re, glob, tempfile, shutil, stat if os.name == 'nt': import scmwindows as scmplatform @@ -187,16 +187,6 @@ class casecollisionauditor(object): self._loweredfiles.add(fl) self._newfiles.add(f) -def develwarn(tui, msg): - """issue a developer warning message""" - msg = 'devel-warn: ' + msg - if tui.tracebackflag: - util.debugstacktrace(msg, 2) - else: - curframe = inspect.currentframe() - calframe = inspect.getouterframes(curframe, 2) - tui.write_err('%s at: %s:%s (%s)\n' % ((msg,) + calframe[2][1:4])) - def filteredhash(repo, maxrev): """build hash of filtered revisions in the current repoview. diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -5,6 +5,7 @@ # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. +import inspect from i18n import _ import errno, getpass, os, socket, sys, tempfile, traceback import config, scmutil, util, error, formatter, progress @@ -958,6 +959,16 @@ class ui(object): ''' return msg + def develwarn(self, msg): + """issue a developer warning message""" + msg = 'devel-warn: ' + msg + if self.tracebackflag: + util.debugstacktrace(msg, 2) + else: + curframe = inspect.currentframe() + calframe = inspect.getouterframes(curframe, 2) + self.write_err('%s at: %s:%s (%s)\n' % ((msg,) + calframe[2][1:4])) + class paths(dict): """Represents a collection of paths and their configs.