Re: How to collaborate using Leo

72 views
Skip to first unread message

Zoom.Quiet

unread,
Apr 16, 2016, 7:36:33 PM4/16/16
to leo-e...@googlegroups.com
i store up this mail in gmail, but never try to fixed code flow EKR's point.
thanks for EKR's Aha, 3 years question, fixed in Leo 5.2 !
notice this, just after terror story:

- i always use Leo to develop complex scripts
+ when start PyQt4 coding, also base Leo
+ but, this time under git-flow
- even upgrade into Leo 5.2, but my skill stan as 4.0
+ as one Leonard, for Nancy in teams
+ i had usage @shadow
+ and of course put .leo into git repository too
- so in the beginning:
+ after 4 hours coding, happy finished one feature develop
+ base git-flow input:
* $ git flow hotfix finish BIG-FEATURE
+ as normal git-flow will:
* Latest objects have been fetched from 'origin'
* Hotfix branch has been merged into 'master'
* The hotfix was tagged 'BIG-FEATURE'
* Hotfix branch has been back-merged into 'develop'
* Hotfix branch 'hotfix/BIG-FEATURE' has been deleted
+ BUT!!! because .leo also in git
* and can not Auto-merging with old version
* the git-flow hotfix flow break
- terror start:
+ try move .leo out git repository, and change @path
+ wants re-write all scripts, merge again
+ BUT! i forgot @shadown node NOT save data for code
+ so, after cmd+s, i got empty .py and .leo_shadow/*.py
- CAN MOVE minutes for so terror:
+ luck remember git keep all verion in breach
+ so revert develop breach
+ change back 'hotfix/BIG-FEATURE'
* into .leo change all @shadow to @nosent
* move .leo out git repository
* chnage @path
+ re-try `$ git flow hotfix finish BIG-FEATURE`
- kill the terror time

through this, i learned:

- .leo is too personal , need not put into git repositry
- @shadow is not strong enough
- nust use new directive

so review leo document, largh in Aha time ;-)
History of Leo — Leo 5.2 documentation
http://leoeditor.com/history.html#genesis-of-clean
and recheck : Appendices — Leo 5.2 documentation
http://leoeditor.com/appendices.html#the-mulder-ream-update-algorithm
notice @clean, and make confirm in:
Summary: @clean vs @file -> Programming with Leo — Leo 5.2 documentation
http://leoeditor.com/tutorial-programming.html#summary-clean-vs-file

for working with Nancy, i need @clean forever!

BUT the new leo-flow with git-flow is lost one command?

- how to updating @cloean nodes in Leo? need not to restart Leo?
- in my test:
+ edit .py out leo, make conflict
+ try cmd+s, leo alert:

... .py
has changed outside Leo.
Overwrite the outline node?

- but try all kind of command in file menus
- not found withch one make Leo :
+ read out .py
+ base The Mulder/Ream algorithm updaing nodes
- so i had to clode all Leo windows
- restart Leo, so the "Recovered Nodes" auto generated


On Mon, Oct 28, 2013 at 6:42 AM, Edward K. Ream <edre...@gmail.com> wrote:
> On Sun, Oct 27, 2013 at 9:01 PM, Zoom.Quiet <zoom....@gmail.com> wrote:
>
>> 2013/10/28 Edward K. Ream <edre...@gmail.com>:
>
>
>> No. The local cache is just a detail :-) It merely needs to remember the
>> files *with* sentinels **on Nancy's local machine.** SCCS repository
>> *never* sees the cache. Only Nancy's push/pull hooks see the cache.
>>
>
> - the ~/.leo dir? sure, is the right space!
> - but, the @shadow algorithm is usage between who?
> - i guess just only can base the local user file and the lastest
> ver
> s
> ion in SCCS ?
>
> The @shadow algorithm is applied just before pushing a new version of one of
> Nancy's files, say x.py. Therefore the input to the @shadow algorithm is:
>
> 1. The cached version of x.py This is the latest version of x.py that was
> pulled from SCCS. It contains sentinels. In @shadow terminology, this is
> the **private file**.
>
> 2. The version of x.py that Nancy is pushing. This file is in Nancy's local
> SCCS repository. This file contains no sentinels. In @shadow terminology,
> this is the **public file**.
>
> - so this ways is perfect for DVCS but svn/csv/vss etc. Center VCS is not
> good.
>
> I believe this scheme will work for any kind of SCCS because the hooks only
> work on a) the local repository and b) the local cache.
>
> ok all clean!
> - wait the brz first show us the prototype hooks
> - just need know how call the @shadow algorithm from Leo
> - in fact, this @shadow algorithm is very useful for other action,
> etc. co-writing system
>
> I don't have time to do a prototype now. Here are the places containing
> relevant code:
>
> - leoShadow.py contains the fundamental @shadow algorithm plus quite a bit
> of support code.
>
> - leoAtFile.py contains the code actually reads and writes @shadow trees:
> See at.readOneAtShadowNode and at.openFileForReading.
>
> The at.atShadow ivar is set True in the init code for @shadow trees, so
> searching for atShadow will show you the special-case code involved. This
> code is tricky, as you will see.
>
> - I have been saying that we can ignore the details of the cache as far as
> the *design* of this scheme goes, but the actual code is non-trivial.
>
> The leoCache.py file contains the fundamental caching code that Leo uses to
> cache files. Using this code is *very* tricky. Here is the relevant code
> from at.read::
>
> if fromString:
> s,loaded,fileKey = fromString,False,None
> else:
> s,loaded,fileKey = c.cacher.readFile(fileName,root)
> # Never read an external file with file-like sentinels from the cache.
> isFileLike = loaded and at.isFileLike(s)
> if not loaded or isFileLike:
> # if trace: g.trace('file-like file',fileName)
> force = True # Disable caching.
> if loaded and not force:
> if trace: g.trace('in cache',fileName)
> at.inputFile.close()
> root.clearDirty()
> return True
>
> For the push hook, fromString will always be False.
>
> It appears that at.isFileLike returns True is the file uses *old-style*
> @file sentinels, so we can ignore this test.
>
> So for the bzr push hook, the simplified code to get the cached file will
> be::
>
> s,loaded,fileKey = c.cacher.readFile(fileName,root)
> if loaded:
> << use s as the contents of the private file >>
>
> The fileKey is used later in at.read to write the newly-read contents of the
> file back to the cache. This write may not be strictly necessary, but it
> would simplify the @shadow algorithm if Nancy pushes the file again before
> pulling it.
>
> To repeat, I don't have time to do this now. I've given you the places from
> which I would start.
>
> Edward

...


--
Life's Pathetic, Let's Pythonic! 人生苦短, Python是岸!
俺: http://zoomquiet.io
授: http://creativecommons.org/licenses/by-sa/2.5/cn/
怒: 冗余不做,日子甭过!备份不做,十恶不赦!
KM keep growing environment culture which promoting organization be learnning!

Edward K. Ream

unread,
Apr 18, 2016, 3:02:23 PM4/18/16
to leo-editor
On Sat, Apr 16, 2016 at 6:36 PM, Zoom.Quiet <zoom....@gmail.com> wrote:

BUT the new leo-flow with git-flow is lost one command?

​You should be able to do what you want.

1. If you set @bool check_for_changed_external_files = True, Leo will automatically update @clean nodes from changes made outside of Leo.

2. Ctrl+Shift+W, (write-at-file-node) will write all @<file> nodes in the selected tree.

3. refresh-from-disk does the reverse: it updates the selected @<file> node from the external file.

HTH.

Edward

Zoom.Quiet

unread,
Apr 18, 2016, 4:19:45 PM4/18/16
to leo-e...@googlegroups.com
On Mon, Apr 18, 2016 at 2:02 PM, Edward K. Ream <edre...@gmail.com> wrote:
>
> On Sat, Apr 16, 2016 at 6:36 PM, Zoom.Quiet <zoom....@gmail.com> wrote:
>
>> http://leoeditor.com/tutorial-programming.html#summary-clean-vs-file
>>
>> ...i need @clean forever!
>>
>> BUT the new leo-flow with git-flow is lost one command?
>
>
> You should be able to do what you want.
>
> 1. If you set @bool check_for_changed_external_files = True, Leo will automatically update @clean nodes from changes made outside of Leo.
>

- setup in MyLeoSettings.leo work will ;-)
- Ctrl+Shift+W need change currently node, not easy as Ctrl+S
- refresh-from-disk is just need, but can not bind right hotkeys ~
look like Leo had used all kinds of hotkeys...

TTH.

> 2. Ctrl+Shift+W, (write-at-file-node) will write all @<file> nodes in the selected tree.
>
> 3. refresh-from-disk does the reverse: it updates the selected @<file> node from the external file.
>
> HTH.
>
> Edward
>
> --
> You received this message because you are subscribed to the Google Groups "leo-editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.
> To post to this group, send email to leo-e...@googlegroups.com.
> Visit this group at https://groups.google.com/group/leo-editor.
> For more options, visit https://groups.google.com/d/optout.

john lunzer

unread,
Apr 18, 2016, 4:31:59 PM4/18/16
to leo-editor
I'm currently using Alt+l for refresh-from-disk. It wasn't being used (I don't think) and seems logical. If a hotkey you want is being used you can go into the global settings and remove it or change it. 

I'm not sure if personal settings override global settings or conflict.

Zoom.Quiet

unread,
Apr 18, 2016, 5:52:06 PM4/18/16
to leo-e...@googlegroups.com
On Mon, Apr 18, 2016 at 3:31 PM, john lunzer <lun...@gmail.com> wrote:
> I'm currently using Alt+l for refresh-from-disk. It wasn't being used (I
> don't think) and seems logical. If a hotkey you want is being used you can
> go into the global settings and remove it or change it.
>

thanks u suggest,
but i cannot fund the refresh-from-disk under
#@settings-->Keyboard shortcuts-->@keys EKR bindings
we can appended by self?

Edward K. Ream

unread,
Apr 18, 2016, 6:04:04 PM4/18/16
to leo-editor
On Mon, Apr 18, 2016 at 3:19 PM, Zoom.Quiet <zoom....@gmail.com> wrote:

- Ctrl+Shift+W need change currently node, not easy as Ctrl+S

​Imo, you shouldn't often need this command if
@bool check_for_changed_external_files = True​

- refresh-from-disk is just need, but can not bind right hotkeys ~
look like Leo had used all kinds of hotkeys...

​All the Ctrl-number ​
 
​are unbound by default.

Furthermore, Leo's history list feature (see the CheetSheet.leo, Executing minibuffer commands) means that once you have executed any minibuffer command, you can re-do that command using <Alt-x> followed by UpArrow or DownArrow.

To answer your question just now, you can bind to refresh-from-disk by putting this in you myLeoSettings.leo:

@shortcuts (headline)

refresh-from-disk = Ctrl-1
(and any other bindings you want).

HTH

Edward

Zoom.Quiet

unread,
Apr 18, 2016, 6:40:35 PM4/18/16
to leo-e...@googlegroups.com
On Mon, Apr 18, 2016 at 5:04 PM, Edward K. Ream <edre...@gmail.com> wrote:
> On Mon, Apr 18, 2016 at 3:19 PM, Zoom.Quiet <zoom....@gmail.com> wrote:
>
>> - Ctrl+Shift+W need change currently node, not easy as Ctrl+S
>
>
> Imo, you shouldn't often need this command if
> @bool check_for_changed_external_files = True
>

Yes, open it, everything be auto now,
buy, under git, always alert me had changed by outdoor,
but in fact, only changed branch, and fixed time.

>> - refresh-from-disk is just need, but can not bind right hotkeys ~
>> look like Leo had used all kinds of hotkeys...
>

Hummm i'm not enjoy vim/emacs , i always need min hotkeys,
thanks suggest, i not setup new hotkeys, just global setup as
@bool check_for_changed_external_files = True

>
> All the Ctrl-number
>
> are unbound by default.
>
> Furthermore, Leo's history list feature (see the CheetSheet.leo, Executing
> minibuffer commands) means that once you have executed any minibuffer
> command, you can re-do that command using <Alt-x> followed by UpArrow or
> DownArrow.
>
> To answer your question just now, you can bind to refresh-from-disk by
> putting this in you myLeoSettings.leo:
>
> @shortcuts (headline)
>
> refresh-from-disk = Ctrl-1
> (and any other bindings you want).
>
> HTH
>
> Edward
>
Reply all
Reply to author
Forward
0 new messages