mercurial/manifest.py
changeset 36174 b42c47b8c9d4
parent 36095 59adb3051718
child 36300 413c179cf7d5
equal deleted inserted replaced
36173:8173eeb69fb3 36174:b42c47b8c9d4
   753         size = len(self._files)
   753         size = len(self._files)
   754         for m in self._dirs.values():
   754         for m in self._dirs.values():
   755             size += m.__len__()
   755             size += m.__len__()
   756         return size
   756         return size
   757 
   757 
       
   758     def __nonzero__(self):
       
   759         # Faster than "__len() != 0" since it avoids loading sub-manifests
       
   760         return not self._isempty()
       
   761 
       
   762     __bool__ = __nonzero__
       
   763 
   758     def _isempty(self):
   764     def _isempty(self):
   759         self._load() # for consistency; already loaded by all callers
   765         self._load() # for consistency; already loaded by all callers
   760         return (not self._files and (not self._dirs or
   766         return (not self._files and (not self._dirs or
   761                 all(m._isempty() for m in self._dirs.values())))
   767                 all(m._isempty() for m in self._dirs.values())))
   762 
   768