Turkey jails generals as PM warns against revenge