mercurial/localrepo.py
changeset 24388 026f8af88e49
parent 24386 d6ac30f4edef
child 24394 03163826b4e6
--- a/mercurial/localrepo.py	Tue Mar 10 21:25:11 2015 -0700
+++ b/mercurial/localrepo.py	Tue Mar 10 21:03:45 2015 -0700
@@ -919,6 +919,15 @@
         return None
 
     def transaction(self, desc, report=None):
+        if (self.ui.configbool('devel', 'all')
+                or self.ui.configbool('devel', 'check-locks')):
+            l = self._lockref and self._lockref()
+            if l is None or not l.held:
+                msg = 'transaction with no lock\n'
+                if self.ui.tracebackflag:
+                    util.debugstacktrace(msg, 1)
+                else:
+                    self.ui.write_err(msg)
         tr = self.currenttransaction()
         if tr is not None:
             return tr.nest()