Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 24388:026f8af88e49
devel: also warn about transaction started without a lock
Nobody should start a transaction on an unlocked repository. If
developer warnings are enabled this will be reported. This use the
same config as bad locking order since this is closely related.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Tue, 10 Mar 2015 21:03:45 -0700 |
parents | d6ac30f4edef |
children | 03163826b4e6 |
comparison
equal
deleted
inserted
replaced
24387:32e16e9cf2cf | 24388:026f8af88e49 |
---|---|
917 if tr and tr.running(): | 917 if tr and tr.running(): |
918 return tr | 918 return tr |
919 return None | 919 return None |
920 | 920 |
921 def transaction(self, desc, report=None): | 921 def transaction(self, desc, report=None): |
922 if (self.ui.configbool('devel', 'all') | |
923 or self.ui.configbool('devel', 'check-locks')): | |
924 l = self._lockref and self._lockref() | |
925 if l is None or not l.held: | |
926 msg = 'transaction with no lock\n' | |
927 if self.ui.tracebackflag: | |
928 util.debugstacktrace(msg, 1) | |
929 else: | |
930 self.ui.write_err(msg) | |
922 tr = self.currenttransaction() | 931 tr = self.currenttransaction() |
923 if tr is not None: | 932 if tr is not None: |
924 return tr.nest() | 933 return tr.nest() |
925 | 934 |
926 # abort here if the journal already exists | 935 # abort here if the journal already exists |