transaction: have _generatefile return a boolean
authorPierre-Yves David <pierre-yves.david@fb.com>
Fri, 17 Oct 2014 21:57:32 -0700
changeset 23357 ba033f461f00
parent 23356 140c21fbf4eb
child 23358 1b51d1b05482
transaction: have _generatefile return a boolean The function returns True if any files were generated. This will be used to know if any pending files have been written.
mercurial/transaction.py
--- a/mercurial/transaction.py	Mon Sep 29 01:29:08 2014 -0700
+++ b/mercurial/transaction.py	Fri Oct 17 21:57:32 2014 -0700
@@ -264,7 +264,9 @@
 
     def _generatefiles(self, suffix=''):
         # write files registered for generation
+        any = False
         for entry in sorted(self._filegenerators.values()):
+            any = True
             order, filenames, genfunc, location = entry
             vfs = self._vfsmap[location]
             files = []
@@ -280,6 +282,7 @@
             finally:
                 for f in files:
                     f.close()
+        return any
 
     @active
     def find(self, file):