On Jul 5, 4:59 am, "Edward K. Ream" <[EMAIL PROTECTED]> wrote:
> It looks like I shall have to abandon the 'redraw' branch and try
> again with a 'redraw2' branch.
...
> So the strategy for the redraw2 branch will be to be more careful :-)

The redraw2 branch is a big success.  It will be merged with the trunk
in the next day or so.

My strategy was:

1. to make changes that were *absolutely guaranteed* to be equivalent
to previous code and

2. to run all unit tests after every change.

The result is that all the old c.begin/endUpdate/try/finally update
code has been replaced by, at most, calls to c.endUpdate().  The
reasons this works are:

A. c.beginUpdate on the trunk does nothing.  Thus, the try/finally
code can be eliminated.  At worst, a call to c.endUpdate() won't be
made on errors, but that doesn't matter.  Indeed, the try/finally code
existed not to ensure the redraw, but to ensure that interlocks
created by old versions of c.beginUpdate got cleared in c.endUpdate.

B. c.endUpdate(False) on the trunk does nothing.

C. I was extremely careful to make *no* other changes, and to make
*no* deductions about what might be a safe "improvement" in code.  I
would have been truly troubled if any unit tests had failed.  None
ever did.

D. At first, I commented out code.  I then used regular-expression
find/changes to remove the commented out code.  This ensured that if
any unit tests had failed I would have known the old code associated
with the failure.  The regex find/changes ensured that removing
commented out code was as foolproof as I could make it.

Present status

- I shall soon remove commented-out code from the core and plugins.
Naturally, I shall once again make these changes in small steps and
run all unit tests after each small step.

- I shall replace the *un-commented-out* calls to 'c.endUpdate()' by
'c.redraw() # was c.endUpdate()'.  Again, this intermediate step (the
comment) will allow me to retain context should catastrophe happen and
a unit test fails.  Of course, a bzr revert would also work, but I
would rather have another backup.

- unitTest.leo already is free from all the old cruft.  The results
are remarkable.  Many tests are 10%, 20%, even 50% shorter than
before.  Many tests contain no drawing code whatever.

- I plan to copy unitTest.leo to the trunk in a kind of manual trial
merge.  Because the new code should be *absolutely equivalent* to the
old code, all unit test should pass in the trunk when using
unitTest.leo from the redraw2 branch.  Something astounding would be
happening if they don't.  If they do pass, I'll update the *trunk*,
thereby removing any possibility of conflict when merging the redraw2
branch.

To repeat, I expect to fully merge the redraw2 branch with the trunk
in one or two days.

Edward
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to