In the TCV tokamak the sawtooth period and the sawtooth amplitude are observed to depend strongly on the shape of the poloidal plasma cross section. Systematic scans of plasma elongation and triangularity show small sawteeth with short periods at high elongation or low and negative triangularity, and large sawteeth with long periods at low elongation or high triangularity. Additional central electron cyclotron heating power further amplifies the shape dependence of the sawtooth properties. The sawtooth period can increase or decrease with additional heating power depending on the plasma shape. This shape dependence is determined by the role of ideal or resistive MHD in triggering the sawtooth crash. For plasma shapes where additional heating and, consequently, a higher pressure shortens the sawtooth period, the low experimental limit of the pressure gradient within the q = 1 surface is consistent with ideal MHD predictions. The observed decrease of this limit with elongation is also in qualitative agreement with ideal MHD theory.