changeset 23290:59513ec76748

transaction: always generate file on close The conditionnal was buggy and file were only generated if "onclose" was defined. By luck, "onclose" was always defined.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 13 Nov 2014 10:22:47 +0000
parents ae5d0a22ee7e
children 03d2d6931836
files mercurial/transaction.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/transaction.py	Sun Nov 09 12:31:34 2014 -0500
+++ b/mercurial/transaction.py	Thu Nov 13 10:22:47 2014 +0000
@@ -329,12 +329,13 @@
     @active
     def close(self):
         '''commit the transaction'''
-        if self.count == 1 and self.onclose is not None:
+        if self.count == 1:
             self._generatefiles()
             categories = sorted(self._finalizecallback)
             for cat in categories:
                 self._finalizecallback[cat](self)
-            self.onclose()
+            if self.onclose is not None:
+                self.onclose()
 
         self.count -= 1
         if self.count != 0: