Mercurial > public > mercurial-scm > hg-stable
diff mercurial/localrepo.py @ 24747:bef8b17443a3
develwarn: refactor the developer warning logic
The logic is currently duplicated and we plan to make it a bit smarter. So we
move it into a function first to make the update more robust and simple.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Sun, 12 Apr 2015 14:24:28 -0400 |
parents | e0c810d0ab69 |
children | d6caadff4779 |
line wrap: on
line diff
--- a/mercurial/localrepo.py Wed Apr 15 01:20:48 2015 -0400 +++ b/mercurial/localrepo.py Sun Apr 12 14:24:28 2015 -0400 @@ -926,11 +926,7 @@ or self.ui.configbool('devel', 'check-locks')): l = self._lockref and self._lockref() if l is None or not l.held: - msg = 'transaction with no lock\n' - if self.ui.tracebackflag: - util.debugstacktrace(msg, 1) - else: - self.ui.write_err(msg) + scmutil.develwarn(self.ui, 'transaction with no lock\n') tr = self.currenttransaction() if tr is not None: return tr.nest() @@ -1220,11 +1216,7 @@ or self.ui.configbool('devel', 'check-locks')): l = self._lockref and self._lockref() if l is not None and l.held: - msg = '"wlock" acquired after "lock"\n' - if self.ui.tracebackflag: - util.debugstacktrace(msg, 1) - else: - self.ui.write_err(msg) + scmutil.develwarn(self.ui, '"wlock" acquired after "lock"\n') def unlock(): if self.dirstate.pendingparentchange():