'Analyze the contents of the BZR dirstate and extract filenames.
:param body: The contents of the file to analyze.
:return: A list of filenames found.'

def bzr_checkout_dirstate(self, body):

    filenames = set()
    header = '#bazaar    dirstate    flat    format    '
    if (body[0:29] != header):
        return set()
    body = body.split('\x00')
    found = True
    for offset in range(0, len(body)):
        filename = body[(offset - 2)]
        if (body[offset] == 'd'):
            if found:
                filenames.add(filename)
            found = (not found)
        elif (body[offset] == 'f'):
            if found:
                filenames.add(filename)
            found = (not found)
    return filenames
