If we are, as Andrew says, to judge the judgment of the two candidates, then the answer is clear. Eighteen months ago John McCain argued that the safest way out of Iraq was to win, then withdraw. Barack Obama, parroting the received wisdom of the Democratic foreign policy establishment, said that victory in any meaningful sense was not only unlikely, but that the presence of large numbers of American soldiers actually fed the insurgency and decreased the prospects for stability. On that crucially important decision, at least, it is becoming ever more obvious that McCain was right and Obama was wrong.
I think McCain was probably right on the surge (although we'll never know for certain what might have happened if we had begun to withdraw last year), but wrong on the initial invasion. Obama was wrong on the surge but right about the invasion (although we'll never know for certain how the world would look if we'd continued (or been able) to contain rather than depose Saddam). So we're left with long-term strategy and medium term diplomacy. And there's the rub. McCain doesn't talk about "winning", then leaving. He talks about "winning", then staying.