mercurial/transaction.py
changeset 23290 59513ec76748
parent 23283 b04263c38a92
child 23291 03d2d6931836
equal deleted inserted replaced
23289:ae5d0a22ee7e 23290:59513ec76748
   327         self._postclosecallback[category] = callback
   327         self._postclosecallback[category] = callback
   328 
   328 
   329     @active
   329     @active
   330     def close(self):
   330     def close(self):
   331         '''commit the transaction'''
   331         '''commit the transaction'''
   332         if self.count == 1 and self.onclose is not None:
   332         if self.count == 1:
   333             self._generatefiles()
   333             self._generatefiles()
   334             categories = sorted(self._finalizecallback)
   334             categories = sorted(self._finalizecallback)
   335             for cat in categories:
   335             for cat in categories:
   336                 self._finalizecallback[cat](self)
   336                 self._finalizecallback[cat](self)
   337             self.onclose()
   337             if self.onclose is not None:
       
   338                 self.onclose()
   338 
   339 
   339         self.count -= 1
   340         self.count -= 1
   340         if self.count != 0:
   341         if self.count != 0:
   341             return
   342             return
   342         self.file.close()
   343         self.file.close()