On May 29, 7:00 am, "Edward K. Ream" <[email protected]> wrote:
> A few days > ago, I found a way to import "live" code into Leo safely: > > Create a bzr repository for the code before importing it > > The Aha is to create the repository *wherever the code is*, including, > say, python/Lib/site-packages. Yesterday I tried this approach with Python's coverage package. Overall, it works well, with all the advertised benefits: - I can make changes within Leo itself. Must faster than using an external editor. - I can clone nodes for study. Big increase in signal/noise ratio. - bzr (or git, or whatever) provides a big big safety net. The diffs always show me what I have done. In particular, bzr qdiff -r1 shows *all* changes I have made. There are few rough edges: 1. Leo's import commands produce good, but not perfect, outlines for python imports. The temptation seems irresistible to "clean up" the imports. This is pretty much pure yak shaving. Worse, the cleanup threatens to introduce unwanted changes. Diff are a imperfect checks. It would be much better to make minimal changes after importing. Before importing larger projects, I'll see if I can improve the importers. This will benefit Leo generally. 2. The import produces "live" @file nodes, that is, @file nodes that will, if altered, change actual files on the file system. That's the whole point, but it means that the .leo file containing the @file nodes is no longer self contained. In particular newlint.leo, the "root" of the new-pylint project, http://groups.google.com/group/leo-and-pylint, no longer suffices to show other people what I have been doing. A workaround would be to change @file to @@file in newlint.py before committing newlint.leo. And then revert newlint.leo. As I write this, I see that a solution similar to leoPyRef.leo will work: I'll commit only newlint.leo (containing @@file nodes) and actually work on newlint-local.leo, containing @file nodes. 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.
