comparison mercurial/scmutil.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 ee751d47cf2c
children d6caadff4779
comparison
equal deleted inserted replaced
24746:e0c810d0ab69 24747:bef8b17443a3
169 if self._abort: 169 if self._abort:
170 raise util.Abort(msg) 170 raise util.Abort(msg)
171 self._ui.warn(_("warning: %s\n") % msg) 171 self._ui.warn(_("warning: %s\n") % msg)
172 self._loweredfiles.add(fl) 172 self._loweredfiles.add(fl)
173 self._newfiles.add(f) 173 self._newfiles.add(f)
174
175 def develwarn(tui, msg):
176 """issue a developer warning message"""
177 if tui.tracebackflag:
178 util.debugstacktrace(msg, 2)
179 else:
180 tui.write_err(msg)
174 181
175 def filteredhash(repo, maxrev): 182 def filteredhash(repo, maxrev):
176 """build hash of filtered revisions in the current repoview. 183 """build hash of filtered revisions in the current repoview.
177 184
178 Multiple caches perform up-to-date validation by checking that the 185 Multiple caches perform up-to-date validation by checking that the