def set_changed_path_list(sbox, revision, changes):
    ' Replace the changed paths list in the revision file REVISION in SBOX\n      with the text CHANGES.'
    idx = None
    fp = open(fsfs_file(sbox.repo_dir, 'revs', str(revision)), 'r+b')
    contents = fp.read()
    length = len(contents)
    if (repo_format(sbox) < 7):
        header = contents[contents.rfind(b'\n', (length - 64), (length - 1)):]
        body_len = int(header.split(b' ')[1])
    else:
        footer_length = contents[(length - 1)]
        if isinstance(footer_length, str):
            footer_length = ord(footer_length)
        footer = contents[((length - footer_length) - 1):(length - 1)]
        l2p_offset = int(footer.split(b' ')[0])
        l2p_checksum = footer.split(b' ')[1]
        p2l_offset = int(footer.split(b' ')[2])
        p2l_checksum = footer.split(b' ')[3]
        idx = FSFS_Index(sbox, revision)
        (offset, item_len, item_type) = idx.get_item(1)
        body_len = offset
        indexes = contents[l2p_offset:((length - footer_length) - 1)]
        file_len = ((body_len + len(changes)) + 1)
        p2l_offset += (file_len - l2p_offset)
        header = ((((((str(file_len).encode() + b' ') + l2p_checksum) + b' ') + str(p2l_offset).encode()) + b' ') + p2l_checksum)
        header += bytes([len(header)])
        header = ((b'\n' + indexes) + header)
    contents = ((contents[:body_len] + changes) + header)
    fp.seek(0)
    fp.write(contents)
    fp.truncate()
    fp.close()
    if (repo_format(sbox) >= 7):
        idx.modify_item(1, offset, (len(changes) + 1))
Replace the changed paths list in the revision file REVISION in SBOX
with the text CHANGES.
def set_changed_path_list(sbox, revision, changes):
    ' Replace the changed paths list in the revision file REVISION in SBOX\n      with the text CHANGES.'
    idx = None
    fp = open(fsfs_file(sbox.repo_dir, 'revs', str(revision)), 'r+b')
    contents = fp.read()
    length = len(contents)
    if (repo_format(sbox) < 7):
        header = contents[contents.rfind(b'\n', (length - 64), (length - 1)):]
        body_len = int(header.split(b' ')[1])
    else:
        footer_length = contents[(length - 1)]
        if isinstance(footer_length, str):
            footer_length = ord(footer_length)
        footer = contents[((length - footer_length) - 1):(length - 1)]
        l2p_offset = int(footer.split(b' ')[0])
        l2p_checksum = footer.split(b' ')[1]
        p2l_offset = int(footer.split(b' ')[2])
        p2l_checksum = footer.split(b' ')[3]
        idx = FSFS_Index(sbox, revision)
        (offset, item_len, item_type) = idx.get_item(1)
        body_len = offset
        indexes = contents[l2p_offset:((length - footer_length) - 1)]
        file_len = ((body_len + len(changes)) + 1)
        p2l_offset += (file_len - l2p_offset)
        header = ((((((str(file_len).encode() + b' ') + l2p_checksum) + b' ') + str(p2l_offset).encode()) + b' ') + p2l_checksum)
        header += bytes([len(header)])
        header = ((b'\n' + indexes) + header)
    contents = ((contents[:body_len] + changes) + header)
    fp.seek(0)
    fp.write(contents)
    fp.truncate()
    fp.close()
    if (repo_format(sbox) >= 7):
        idx.modify_item(1, offset, (len(changes) + 1))