def _update_state_for_path_changed( self, path, actual_inode, actual_mtime, actual_size, known_checksum=None, ): if known_checksum: md5, info = known_checksum, None else: md5, info = self._collect(path) cmd = ("UPDATE {} SET " 'mtime = "{}", size = "{}", ' 'md5 = "{}", timestamp = "{}" ' "WHERE inode = {}") self._execute( cmd.format( self.STATE_TABLE, actual_mtime, actual_size, md5, current_timestamp(), self._to_sqlite(actual_inode), )) return md5, info
def _update_state_record_timestamp_for_inode(self, actual_inode): cmd = "UPDATE {} SET timestamp = ? WHERE inode = ?".format( self.STATE_TABLE ) self._execute( cmd, (current_timestamp(), self._to_sqlite(actual_inode)) )
def _update_state_record_timestamp_for_inode(self, actual_inode): cmd = 'UPDATE {} SET timestamp = "{}" WHERE inode = {}' self._execute( cmd.format( self.STATE_TABLE, current_timestamp(), self._to_sqlite(actual_inode), ))
def _update_cache_directory_state(self): cache_path = self.repo.cache.local.cache_dir mtime, size = get_mtime_and_size(cache_path) inode = get_inode(cache_path) cmd = ("INSERT OR REPLACE INTO {}(inode, size, mtime, timestamp, md5) " 'VALUES ({}, "{}", "{}", "{}", "")'.format( self.STATE_TABLE, self._to_sqlite(inode), size, mtime, current_timestamp(), )) self._execute(cmd)
def _update_state_for_path_changed(self, path, actual_inode, actual_mtime, actual_size, checksum): cmd = ("UPDATE {} SET " 'mtime = "{}", size = "{}", ' 'md5 = "{}", timestamp = "{}" ' "WHERE inode = {}") self._execute( cmd.format( self.STATE_TABLE, actual_mtime, actual_size, checksum, current_timestamp(), self._to_sqlite(actual_inode), ))
def _update_state_for_path_changed(self, actual_inode, actual_mtime, actual_size, checksum): cmd = ("UPDATE {} SET " "mtime = ?, size = ?, " "md5 = ?, timestamp = ? " "WHERE inode = ?").format(self.STATE_TABLE) self._execute( cmd, ( actual_mtime, actual_size, checksum, current_timestamp(), self._to_sqlite(actual_inode), ), )
def _insert_new_state_record(self, path, actual_inode, actual_mtime, actual_size, checksum): assert checksum is not None cmd = ("INSERT INTO {}(inode, mtime, size, md5, timestamp) " 'VALUES ({}, "{}", "{}", "{}", "{}")') self._execute( cmd.format( self.STATE_TABLE, self._to_sqlite(actual_inode), actual_mtime, actual_size, checksum, current_timestamp(), )) self.inserts += 1
def _insert_new_state_record(self, actual_inode, actual_mtime, actual_size, checksum): assert checksum is not None cmd = ("INSERT INTO {}(inode, mtime, size, md5, timestamp) " "VALUES (?, ?, ?, ?, ?)").format(self.STATE_TABLE) self._execute( cmd, ( self._to_sqlite(actual_inode), actual_mtime, actual_size, checksum, current_timestamp(), ), ) self.inserts += 1
def _insert_new_state_record(self, path, actual_inode, actual_mtime, actual_size, known_checksum): if known_checksum: md5, info = known_checksum, None else: md5, info = self._collect(path) cmd = ("INSERT INTO {}(inode, mtime, size, md5, timestamp) " 'VALUES ({}, "{}", "{}", "{}", "{}")') self._execute( cmd.format( self.STATE_TABLE, self._to_sqlite(actual_inode), actual_mtime, actual_size, md5, current_timestamp(), )) self.inserts += 1 return md5, info