code: 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()
docs: Scope all future interactions to the current hook execution
          revision.