Changeset 19 in tracdarcs


Ignore:
Timestamp:
02/15/06 16:29:34 (7 years ago)
Author:
lele@…
Hash name:
20060215152934-7a6fb-cfb78b11dcc8aa50b6ccc6e7fc0d4946635a2f65
Message:

At resync time, delete the whole content of the revision_hash table

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tracdarcs/cache.py

    r18 r19  
    7373                              "a 'trac-admin resync' operation is needed.") 
    7474 
     75        # Maybe this is a resync. The only way to detect that is 
     76        # by checking the revision table: if it's empty then we 
     77        # are either at the first sync, or at a resync. In both 
     78        # cases we are safe in dropping the revision_hash content. 
     79        cursor.execute("SELECT rev FROM revision") 
     80        row = cursor.fetchone() 
     81        if not row:                
     82            cursor.execute("DELETE FROM revision_hash") 
     83 
    7584        youngest_stored = self.repos.get_youngest_rev_in_cache(self.db) 
    7685 
Note: See TracChangeset for help on using the changeset viewer.