Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.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 | ce9e231265c1 |
children | 328739ea70c3 |
comparison
equal
deleted
inserted
replaced
25628:9c647f427aef | 25629:52e5f68d8363 |
---|---|
951 def transaction(self, desc, report=None): | 951 def transaction(self, desc, report=None): |
952 if (self.ui.configbool('devel', 'all-warnings') | 952 if (self.ui.configbool('devel', 'all-warnings') |
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() |
960 | 960 |
961 # abort here if the journal already exists | 961 # abort here if the journal already exists |
1256 # acquisition would not cause dead-lock as they would just fail. | 1256 # acquisition would not cause dead-lock as they would just fail. |
1257 if wait and (self.ui.configbool('devel', 'all-warnings') | 1257 if wait and (self.ui.configbool('devel', 'all-warnings') |
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(): |
1265 self.dirstate.invalidate() | 1265 self.dirstate.invalidate() |
1266 else: | 1266 else: |