Shortened from if it isn't ___, I'll eat my hat! or similar construction.
if it isn't... (past tense if it wasn't)