[PATCH 2 of 9 mergedriver] filemerge: turn filemerge.filemerge into a class

Siddharth Agarwal sid at less-broken.com
Thu Oct 8 01:48:17 CDT 2015


On 10/7/15 10:22 PM, Pierre-Yves David wrote:
> I've pruned them. But be aware that last time I tried to yield the 
> coroutine hammer, mpm stopped me because they were "too obscure python 
> feature that will confuse contributor"
>

In this case a coroutine turns out to be *much* simpler than an explicit 
state machine. I actually have a state machine implementation [1] but it 
turns out to be twice the length of a coroutine that does the exact same 
thing.

[1] 
http://42.netv6.net/sid0-wip/hg/file/c307a3387a95/mercurial/filemerge.py#l440


More information about the Mercurial-devel mailing list