I should have commented that or added an explicit assertion.  My initial version of the code actually resulted in an exception on that line because after reversion the node was left in a checked-in state.