mercurial/posix.py
changeset 22245 234e4c24b980
parent 20202 a6014018ec28
child 22246 331cbf088c4c
equal deleted inserted replaced
22244:172036d60b22 22245:234e4c24b980
   565     return st and stat.S_ISLNK(st.st_mode)
   565     return st and stat.S_ISLNK(st.st_mode)
   566 
   566 
   567 def statisexec(st):
   567 def statisexec(st):
   568     '''check whether a stat result is an executable file'''
   568     '''check whether a stat result is an executable file'''
   569     return st and (st.st_mode & 0100 != 0)
   569     return st and (st.st_mode & 0100 != 0)
       
   570 
       
   571 def readpipe(pipe):
       
   572     """Read all available data from a pipe."""
       
   573     chunks = []
       
   574     while True:
       
   575         size = os.fstat(pipe.fileno()).st_size
       
   576         if not size:
       
   577             break
       
   578 
       
   579         s = pipe.read(size)
       
   580         if not s:
       
   581             break
       
   582         chunks.append(s)