mercurial/localrepo.py
changeset 23379 86c6f06feb04
parent 23311 64ab33ffba14
child 23426 19ebd2f88fc7
--- a/mercurial/localrepo.py	Thu Nov 13 11:11:17 2014 +0000
+++ b/mercurial/localrepo.py	Thu Nov 13 11:12:47 2014 +0000
@@ -865,9 +865,16 @@
     def wwritedata(self, filename, data):
         return self._filter(self._decodefilterpats, filename, data)
 
-    def transaction(self, desc, report=None):
+    def currenttransaction(self):
+        """return the current transaction or None if non exists"""
         tr = self._transref and self._transref() or None
         if tr and tr.running():
+            return tr
+        return None
+
+    def transaction(self, desc, report=None):
+        tr = self.currenttransaction()
+        if tr is not None:
             return tr.nest()
 
         # abort here if the journal already exists