def resetState(self): s = State(self._stateDir, self._repository.id) try: s.setToLastCleanState() finally: s.close()