def enter_detached_state(self):
        # Dictionary to pass along state to advance()
        next_state_kwargs = {}

        # Enter detached HEAD state
        print 'Entering detached HEAD state with contents from %s.' % (
                self.__branch,)
        current_branch_detached = '%s@{0}' % (self.__branch,)
        result, _, stderr = utils.capture_command(
                'git', 'checkout', current_branch_detached,
                expect_success=False)

        if result != 0:
            next_state_kwargs['error_message'] = stderr
            self.state = self.NOTIFY_FAILURE
        else:
            self.state = self.SET_HISTORY_FROM_REMOTE

        self.advance(**next_state_kwargs)
Enters detached HEAD state with review contents.
dataset/ETHPy150Open googlearchive/git-rv/submit.py/SubmitAction.enter_detached_state