Warning: Rev 5583 contains disabled new read/write code

21 views
Skip to first unread message

Edward K. Ream

unread,
Jan 22, 2013, 8:18:08 AM1/22/13
to leo-e...@googlegroups.com
Rev 5583 contains the new read/write code that will, when enabled, allow clones anywhere in an @file tree.  However, the old rule that clones may not be descendants of themselves is still in effect.  This rule will never go away.

Anyone using this rev should do so only on disposable code, or code that is protected by being part of some kind of source code repository.

This code is enabled/disabled by the allow_cloned_sibs at the start of leoAtFile.py.  This switch is False in this rev, which should mean that the new code is functionally identical to the old.  However, I wouldn't bet my life on it, despite reasonable testing.

The truly adventurous may want to set allow_cloned_sibs = True and see what happens :-)  The new code passes all the hand tests I can think of, which may say more about my imagination than the quality of the code!

Please report any problems with this code immediately.  I plan to commit a version with allow_cloned_sibs = True only after using the code myself for at least a day or two.

Edward

Edward K. Ream

unread,
Jan 22, 2013, 8:26:34 AM1/22/13
to leo-e...@googlegroups.com
On Tuesday, January 22, 2013 7:18:08 AM UTC-6, Edward K. Ream wrote:

> The truly adventurous may want to set allow_cloned_sibs = True and see what happens :-)  The new code passes all the hand tests I can think of, which may say more about my imagination than the quality of the code!

Despite these caveats, the new code is actually fairly simple.  There are a lot of "if" statements involved, but they only select the proper read/write code given all the various flavors of nodes & versions that Leo must support.  The heart of the new code are the methods at.new_createThinChild4 and at.createV5ThinNode.  These methods have the minimal number of "if" statements: there can be no combinatorial explosion of complexity.  This means that if the code works at all it should work everywhere.  That is my hope, at any rate.

In fact, the two methods mentioned in the previous paragraph are almost the only changed methods in the read code, with the exception of refactoring in at.createNewThinNode.  I took great pains to ensure that as little as possible changed.  In particular, it was imperative that the at.changeLevel method did not change: it is used in two many read paths.  Changing it significantly would likely have broken seldom-used legacy read code.

Edward

Edward
Reply all
Reply to author
Forward
0 new messages