'Read status file in the current format.
Arguments:
- fp: I/O object that points to the opened database file.'

def readstatus(self, fp):

    for line in fp:
        line = line.strip()
        try:
            (uid, flags, mtime, labels) = line.split('|')
            uid = int(uid)
            flags = set(flags)
            mtime = int(mtime)
            labels = set([lb.strip() for lb in labels.split(',') if (len(lb.strip()) > 0)])
        except ValueError as e:
            errstr = ("Corrupt    line    '%s'    in    cache    file    '%s'" % (line, self.filename))
            self.ui.warn(errstr)
            six.reraise(ValueError, ValueError(errstr), exc_info()[2])
        self.messagelist[uid] = self.msglist_item_initializer(uid)
        self.messagelist[uid]['flags'] = flags
        self.messagelist[uid]['mtime'] = mtime
        self.messagelist[uid]['labels'] = labels
