Mercurial > hg-stable
comparison mercurial/scmutil.py @ 25629:52e5f68d8363
devel-warn: move the develwarn function as a method of the ui object
We are going to use this feature in more and more place. Having to import
scmutil makes it an import cycle hell.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Fri, 19 Jun 2015 11:19:45 -0700 |
parents | f64dbe06f3d0 |
children | e93036747902 |
comparison
equal
deleted
inserted
replaced
25628:9c647f427aef | 25629:52e5f68d8363 |
---|---|
8 from i18n import _ | 8 from i18n import _ |
9 from mercurial.node import nullrev | 9 from mercurial.node import nullrev |
10 import util, error, osutil, revset, similar, encoding, phases | 10 import util, error, osutil, revset, similar, encoding, phases |
11 import pathutil | 11 import pathutil |
12 import match as matchmod | 12 import match as matchmod |
13 import os, errno, re, glob, tempfile, shutil, stat, inspect | 13 import os, errno, re, glob, tempfile, shutil, stat |
14 | 14 |
15 if os.name == 'nt': | 15 if os.name == 'nt': |
16 import scmwindows as scmplatform | 16 import scmwindows as scmplatform |
17 else: | 17 else: |
18 import scmposix as scmplatform | 18 import scmposix as scmplatform |
184 if self._abort: | 184 if self._abort: |
185 raise util.Abort(msg) | 185 raise util.Abort(msg) |
186 self._ui.warn(_("warning: %s\n") % msg) | 186 self._ui.warn(_("warning: %s\n") % msg) |
187 self._loweredfiles.add(fl) | 187 self._loweredfiles.add(fl) |
188 self._newfiles.add(f) | 188 self._newfiles.add(f) |
189 | |
190 def develwarn(tui, msg): | |
191 """issue a developer warning message""" | |
192 msg = 'devel-warn: ' + msg | |
193 if tui.tracebackflag: | |
194 util.debugstacktrace(msg, 2) | |
195 else: | |
196 curframe = inspect.currentframe() | |
197 calframe = inspect.getouterframes(curframe, 2) | |
198 tui.write_err('%s at: %s:%s (%s)\n' % ((msg,) + calframe[2][1:4])) | |
199 | 189 |
200 def filteredhash(repo, maxrev): | 190 def filteredhash(repo, maxrev): |
201 """build hash of filtered revisions in the current repoview. | 191 """build hash of filtered revisions in the current repoview. |
202 | 192 |
203 Multiple caches perform up-to-date validation by checking that the | 193 Multiple caches perform up-to-date validation by checking that the |