~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to weave.py

  • Committer: Martin Pool
  • Date: 2005-06-28 14:10:14 UTC
  • mto: This revision was merged to the branch mainline in revision 852.
  • Revision ID: mbp@sourcefrog.net-20050628141014-01deff4d9219ee74
Fix bug in an update edit that both deletes and inserts -- previously
the insert was clobbered by our own delete.

Add some tests that do such updates.

Clean up imports of pformat.

Show diffs side-by-side

added added

removed removed

Lines of Context:
159
159
                    # is this OK???
160
160
 
161
161
                if newlines:
162
 
                    i = i1 + offset
 
162
                    # there may have been a deletion spanning up to
 
163
                    # i2; we want to insert after this region to make sure
 
164
                    # we don't destroy ourselves
 
165
                    i = i2 + offset
163
166
                    self._l[i:i] = [('{', idx)] \
164
167
                                   + newlines \
165
168
                                   + [('}', idx)]