code: def iter_entries(cls, stream):
          
          new_entry = RefLogEntry.from_line
          if isinstance(stream, string_types):
              stream = file_contents_ro_filepath(stream)
          # END handle stream type
          while True:
              line = stream.readline()
              if not line:
                  return
              yield new_entry(line.strip())
          # END endless loop
          stream.close()
docs: :return: Iterator yielding RefLogEntry instances, one for each line read
              sfrom the given stream.
          :param stream: file-like object containing the revlog in its native format
              or basestring instance pointing to a file to read