##// END OF EJS Templates
devel-warn: move the develwarn function as a method of the ui object...
Pierre-Yves David -
r25629:52e5f68d default
parent child Browse files
Show More
@@ -953,7 +953,7 b' class localrepository(object):'
953 or self.ui.configbool('devel', 'check-locks')):
953 or self.ui.configbool('devel', 'check-locks')):
954 l = self._lockref and self._lockref()
954 l = self._lockref and self._lockref()
955 if l is None or not l.held:
955 if l is None or not l.held:
956 scmutil.develwarn(self.ui, 'transaction with no lock')
956 self.ui.develwarn('transaction with no lock')
957 tr = self.currenttransaction()
957 tr = self.currenttransaction()
958 if tr is not None:
958 if tr is not None:
959 return tr.nest()
959 return tr.nest()
@@ -1258,7 +1258,7 b' class localrepository(object):'
1258 or self.ui.configbool('devel', 'check-locks')):
1258 or self.ui.configbool('devel', 'check-locks')):
1259 l = self._lockref and self._lockref()
1259 l = self._lockref and self._lockref()
1260 if l is not None and l.held:
1260 if l is not None and l.held:
1261 scmutil.develwarn(self.ui, '"wlock" acquired after "lock"')
1261 self.ui.develwarn('"wlock" acquired after "lock"')
1262
1262
1263 def unlock():
1263 def unlock():
1264 if self.dirstate.pendingparentchange():
1264 if self.dirstate.pendingparentchange():
@@ -10,7 +10,7 b' 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
@@ -187,16 +187,6 b' class casecollisionauditor(object):'
187 self._loweredfiles.add(fl)
187 self._loweredfiles.add(fl)
188 self._newfiles.add(f)
188 self._newfiles.add(f)
189
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
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
@@ -5,6 +5,7 b''
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 import inspect
8 from i18n import _
9 from i18n import _
9 import errno, getpass, os, socket, sys, tempfile, traceback
10 import errno, getpass, os, socket, sys, tempfile, traceback
10 import config, scmutil, util, error, formatter, progress
11 import config, scmutil, util, error, formatter, progress
@@ -958,6 +959,16 b' class ui(object):'
958 '''
959 '''
959 return msg
960 return msg
960
961
962 def develwarn(self, msg):
963 """issue a developer warning message"""
964 msg = 'devel-warn: ' + msg
965 if self.tracebackflag:
966 util.debugstacktrace(msg, 2)
967 else:
968 curframe = inspect.currentframe()
969 calframe = inspect.getouterframes(curframe, 2)
970 self.write_err('%s at: %s:%s (%s)\n' % ((msg,) + calframe[2][1:4]))
971
961 class paths(dict):
972 class paths(dict):
962 """Represents a collection of paths and their configs.
973 """Represents a collection of paths and their configs.
963
974
General Comments 0
You need to be logged in to leave comments. Login now