Comment 12 for bug 480102

Revision history for this message
Tres Seaver (tseaver) wrote :

Reproducing with bzr 2.1.1

 $ bzr --version
 Bazaar (bzr) 2.1.1
 ...
 $ bzr plugins | grep ^svn
 svn 1.0.3dev
:$ export KSVN=http://osi.agendaless.com/bfgsvn
 $ bzr co $KSVN/karl/trunk karl

At the time that the assert happens, the following state seems interestnig:

- The SVN revision which triggers the failure is r5147.

- The file for the failure is 'karl/trunk/karl/content/views/wiki.py',
  which has the following revisions of interest on the trunk;

  * Revision 4908:

    $ svn log -r 4908 $KSVN/karl/trunk/karl/content/views/wiki.py
    ------------------------------------------------------------------------
    r4908 | Rob Miller <email address hidden> | 2010-02-25 21:48:07 -0500 (Thu, 25 Feb 2010) | 6 lines

    move the commits that i accidentally made to a tag over to the trunk, where
    they belong. addresses the following 2 issues:

    https://bugs.launchpad.net/karl3/+bug/522179
    https://bugs.launchpad.net/karl3/+bug/523280

    ------------------------------------------------------------------------
    $ svn cat -r 4908 $KSVN/karl/trunk/karl/content/views/wiki.py | wc -c
    11228
    $ svn cat -r 4908 $KSVN/karl/trunk/karl/content/views/wiki.py | sha1sum
    310284f4a879826a525bc5ca97a1247856399f75 -

  * Revision 5090:

    $ svn log -r 5090 $KSVN/karl/trunk/karl/content/views/wiki.py
    ------------------------------------------------------------------------
    r5090 | Balazs Ree <email address hidden> | 2010-04-01 16:33:58 -0400 (Thu, 01 Apr 2010) | 1 line

    Merge ree-imagedrawer branch
    ------------------------------------------------------------------------
    $ svn cat -r 5090 $KSVN/karl/trunk/karl/content/views/wiki.py | wc -c
    11307
    $ svn cat -r 5090 $KSVN/karl/trunk/karl/content/views/wiki.py | sha1sum
    c079d758b9131f6990e4d78b82792cb4a6edba17 -

  * Revision 5147

    $ svn log -r 5147 $KSVN/karl/trunk/karl/content/views/wiki.py
    ------------------------------------------------------------------------
    r5147 | Balazs Ree <email address hidden> | 2010-04-07 13:27:11 -0400 (Wed, 07 Apr 2010) | 4 lines

    Implement experimental url switch for imagedrawer
    it's only active on wiki pages, if the ?enable_imagedrawer url
    parameter is entered manually. Otherwise, old style widget works
    by default.
    ------------------------------------------------------------------------
    $ svn cat -r 5147 $KSVN/karl/trunk/karl/content/views/wiki.py | wc -c
    11625
    $ svn cat -r 5147 $KSVN/karl/trunk/karl/content/views/wiki.py | sha1sum
    a409721a7a35eb3e9df0e8052b7a30ff839dc3ae -

Just before the application of the textdelta which fails with the assert,
the FileRevisionBuildEditor object is created for this file, with the
following arguments:

  'editor':
    revid: 'svn-v4:4f889dee-8c54-0410-98c1-98789d956ae4:karl/trunk:5147'
    'base_tree':
         rev_id: 'svn-v4:4f889dee-8c54-0410-98c1-98789d956ae4:karl/trunk:5146'
    'parent_trees':
         rev_id='svn-v4:4f889dee-8c54-0410-98c1-98789d956ae4:karl/trunk:5146',
         rev_id='svn-v4:4f889dee-8c54-0410-98c1-98789d956ae4:karl/trunk:5146'
    'inventory': None

  'old_path': u'karl/content/views/wiki.py'

  'path': u'karl/content/views/wiki.py'

  'file_id': '4146@4f889dee-8c54-0410-98c1-98789d956ae4:karl%2Ftrunk%2Fkarl%2Fcontent%2Fviews%2Fwiki.py'

  'parent_file_id': '4146@4f889dee-8c54-0410-98c1-98789d956ae4:karl%2Ftrunk%2Fkarl%2Fcontent%2Fviews'

  'base_ie':
    file_id: '4146@4f889dee-8c54-0410-98c1-98789d956ae4:karl%2Ftrunk%2Fkarl%2Fcontent%2Fviews%2Fwiki.py'
    name: u'wiki.py'
    reference_revision: None
    revision: 'svn-v4:4f889dee-8c54-0410-98c1-98789d956ae4:karl/trunk:4908'
    text_sha1: 'c079d758b9131f6990e4d78b82792cb4a6edba17'
    text_size: 11307

  'is_symlink': False

At the point where the assert triggers, the source text matches exactly
the text for svn r4908, but the diff being applied is the diff for svn r5147,
which is a diff against r5090: at that point, the length check rightly
fails.

I believe the bug is that somehow, the 'base_ie' object gets associated with
the wrong revision (that string says to me that it is svn r4908), in spite
of the fact that it has the correct size and SHA1 hash (for svn r5090).