The bloodshed part was smaller than the 'not-bloodshed' part, because it was not the US military might that cut Mexico in two.
When Mexico declared independence, the overwhelming majority of the area administered by Mexico City broke away. This included the end of Panama where I'm at up, clear up to Oregon (claimed by among others- Russia). Mexico got back Tijuana and Nogales by killing off a lot of Mexicans, but Texas (like Guatemala etc.) made it stick. California's independent concession from Mexico is what isolated the territories in between, not the US army. The biggest direct US role in setting the present border was the Gadson Purchase.
OK, the US army took over Mexico City, but I thought we gave that back.