Modify ↓
      
        Opened 18 years ago
Closed 4 years ago
#2284 closed defect (wontfix)
trac-admin resync fails after installing PerforcePlugin
| Reported by: | anonymous | Owned by: | ttressieres | 
|---|---|---|---|
| Priority: | normal | Component: | PerforcePlugin | 
| Severity: | normal | Keywords: | |
| Cc: | Trac Release: | 0.10 | 
Description
After installing the Perforce plugin and all its dependencies, and adding p4trac to the components section of the ini file of a newly initialized environment, I cannot resync with the Perforce repository:
C:\Python24\Scripts>..\python.exe trac-admin c:\tracenv resync Resyncing repository history... Command failed: The 'repository_dir' has changed a 'trac-admin resync' operation is needed
The ini file contains this:
repository_dir = p4://user:password@10.0.0.123:1666/?unicode=0 repository_type = perforce
Attachments (0)
Change History (5)
comment:1 Changed 18 years ago by
comment:3 Changed 18 years ago by
| Owner: | changed from Lewis Baker to ttressieres | 
|---|---|
| Status: | new → assigned | 
comment:5 Changed 4 years ago by
| Resolution: | → wontfix | 
|---|---|
| Status: | assigned → closed | 
Plugin is deprecated.
Note: See
        TracTickets for help on using
        tickets.
    



I do not get this bug with Trac 0.10.3.1 or previous versions, only with Trac 0.10.4.
This seems to be due to a change in trac/scripts/admin.py, line 675:
Trac 0.10.3.1
def do_resync(self, line): print 'Resyncing repository history...' cnx = self.db_open() cursor = cnx.cursor() cursor.execute("DELETE FROM revision") cursor.execute("DELETE FROM node_change") cursor.execute("DELETE FROM system WHERE name='repository_dir'") repos = self.__env.get_repository() # this will do the sync() print 'Done.'Trac 0.10.4
def do_resync(self, line): env = self.env_open() argv = self.arg_tokenize(line) if argv: rev = argv[0] if rev: env.get_repository().sync_changeset(rev) print '%s resynced.' % rev return from trac.versioncontrol.cache import CACHE_METADATA_KEYS print 'Resyncing repository history... ' cnx = self.db_open() cursor = cnx.cursor() cursor.execute("DELETE FROM revision") cursor.execute("DELETE FROM node_change") cursor.executemany("DELETE FROM system WHERE name=%s", [(k,) for k in CACHE_METADATA_KEYS]) cursor.executemany("INSERT INTO system (name, value) VALUES (%s, %s)", [(k, '') for k in CACHE_METADATA_KEYS]) cnx.commit() repos = self._resync(env.get_repository()) cursor.execute("SELECT count(rev) FROM revision") for cnt, in cursor: print cnt, 'revisions cached.', print 'Done.'I think p4trac is expecting the "DELETE FROM system WHERE name='repository_dir'" part but not getting it in 0.10.4.