Edgewall Software

Changes between Initial Version and Version 1 of Ticket #10884, comment 2


Ignore:
Timestamp:
Feb 16, 2014, 4:03:31 PM (10 years ago)
Author:
Jun Omae

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #10884, comment 2

    initial v1  
    11Here is the typical command line I use:
    2 
    3 #trac-admin /srv/trac/E05058SB repository resync "" 5429
    4 
     2{{{
     3# trac-admin /srv/trac/E05058SB repository resync "" 5429
     4}}}
    55so in the ticket I used a generalized description.
    66
    77Without the patch, the command you suggest (sync) fails with the same error:
     8{{{
     9# trac-admin /srv/trac/E05058SB repository sync "" 5429
     10}}}
     11produces the output: `TypeError: int argument required`
    812
    9 #trac-admin /srv/trac/E05058SB repository sync "" 5429
     13If you look more closely at the source code (`cache.py` / `sync_changeset`), it's rather easy to understand this error message:
    1014
    11 produces the output: TypeError: int argument required
    12 
    13 If you look more closely at the source code (cache.py / sync_changeset), it's rather easy to understand this error message:
    14 
    15 the rev parameter that's passed to _insert_changeset() is a unicode string when it should be an int - _insert_changeset() fails at line 289 (cache.py) when calling db_rev(rev) from class SvnCachedRepository (svn_fs.py line 237):
     15the rev parameter that's passed to `_insert_changeset()` is a unicode string when it should be an int - `_insert_changeset()` fails at line 289 (`cache.py`) when calling `db_rev(rev)` from class `SvnCachedRepository` (`svn_fs.py` line 237):
    1616
    1717
     
    2323So you see an int is expected.
    2424
    25 That's why the patch I attached uses the normalize_rev() function so as to convert the revision to an int.
     25That's why the patch I attached uses the `normalize_rev()` function so as to convert the revision to an int.
    2626
    2727When this type error is fixed, the revision and node_change tables are updated correctly, but the repository table still has not the lastest revision, therefore the remaining lines of the patch update the repository table and delete the metadata so it gets updated too.
    2828
    29 I don't know the TRAC modules enough to be sure this patch is optimum but for sure it does work when it is applied: the cache seems correctly updated because the changeset can then be displayed and the timeline shows the revision that was missing.
     29I don't know the Trac modules enough to be sure this patch is optimum but for sure it does work when it is applied: the cache seems correctly updated because the changeset can then be displayed and the timeline shows the revision that was missing.