def hook_scope(self, name=""):
        """Scope all future interactions to the current hook execution
        revision."""
        assert not self.revision
        self.cursor.execute(
            'insert into hooks (hook, date) values (?, ?)',
            (name or sys.argv[0],
             datetime.datetime.utcnow().isoformat()))
        self.revision = self.cursor.lastrowid
        try:
            yield self.revision
            self.revision = None
        except Exception:
            self.flush(False)
            self.revision = None
            raise
        else:
            self.flush()
def hook_scope ( self , name = "" ) : assert not self . revision self . cursor . execute ( 'insert into hooks (hook, date) values (?, ?)' , ( name or sys . argv [ 0 ] , datetime . datetime . utcnow ( ) . isoformat ( ) ) ) self . revision = self . cursor . lastrowid try : yield self . revision self . revision = None except Exception : self . flush ( False ) self . revision = None raise else : self . flush ( )
Scope all future interactions to the current hook execution
        revision.