~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/weave.py

  • Committer: John Arbash Meinel
  • Date: 2006-01-31 14:09:11 UTC
  • mto: (1185.50.65 bzr-jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1554.
  • Revision ID: john@arbash-meinel.com-20060131140911-3bc59456e076f236
When reweaving weaves, if texts don't match, log the differences rather than a plain assert

Show diffs side-by-side

added added

removed removed

Lines of Context:
946
946
        if name in wa._name_map:
947
947
            lines = wa.get_lines(name)
948
948
            if name in wb._name_map:
949
 
                assert lines == wb.get_lines(name)
 
949
                lines_b = wb.get_lines(name)
 
950
                if lines != lines_b:
 
951
                    mutter('Weaves differ on content. rev_id {%s}', name)
 
952
                    mutter('weaves: %s, %s', wa._weave_name, wb._weave_name)
 
953
                    import difflib
 
954
                    lines = list(difflib.unified_diff(lines, lines_b,
 
955
                            wa._weave_name, wb._weave_name))
 
956
                    mutter('lines:\n%s', ''.join(lines))
 
957
                    raise errors.WeaveTextDiffers(name, wa, wb)
950
958
        else:
951
959
            lines = wb.get_lines(name)
952
960
        wr.add(name, combined_parents[name], lines)