Writes a changeset to a file