def enter_diff_mode(self, context_model=None):
assert not self.diff_mode<EOL>self.diff_mode = True<EOL>if context_model is None:<EOL><INDENT>self.diff_from_source = True<EOL>self.diff_context_model = self.context_model.copy()<EOL><DEDENT>else:<EOL><INDENT>self.diff_from_source = False<EOL>self.diff_context_model = context_model<EOL><DEDENT>self.clear()<EOL>self.setColumnCount(<NUM_LIT:5>)<EOL>self.refresh()<EOL>
Enter diff mode.

        Args:
            context_model (`ContextModel`): Context to diff against. If None, a
            copy of the current context is used.