Side-effects are basically everything related to writes, like mutating
(wrapping) internal Python objects, etc. They are done by Python code
provided by an extension out of core's control. Usually that means
reposetup, uisetup, etc.

Reading things is fine - loading configs, changelog.i, obsstore, etc. as
long as no malicious extension changes the loading logic. Currently for chg
to work correctly, this assumption must be true.

The difference of the above two is whether we can revert the effects. For
objects loaded by reading certain things, once we discard the object, the
effect is considered reverted. But for things like x.__class__ = y;
extensions.wrapfoo(...), etc., they are basically impossible to revert
cleanly (confidently). So we avoid them at all costs.


Excerpts from Kevin Bullock's message of 2017-02-10 14:53:22 -0600:
> > On Feb 9, 2017, at 19:46, Jun Wu <qu...@fb.com> wrote:
> > 
> > # HG changeset patch
> > # User Jun Wu <qu...@fb.com>
> > # Date 1486675034 28800
> > #      Thu Feb 09 13:17:14 2017 -0800
> > # Node ID 5e47a19fae82f4659f1e7df37f8f26dd56c4f246
> > # Parent  2c1834e1e6b5f734c27199d47de9b2252b8f4913
> > # Available At https://bitbucket.org/quark-zju/hg-draft 
> > #              hg pull https://bitbucket.org/quark-zju/hg-draft  -r 
> > 5e47a19fae82
> > localrepo: move ui loading to baselocalrepository
> 
> I can't quite say exactly why, but it surprised me that you're loading the
> repo's hgrc in the "side-effect-free" base class. We're not loading
> extensions, but the hgrc can maybe do other things that could be
> considered "side effects".
> 
> It's a vague request I know, but could you tell us a little bit more about
> what specific "side effects" get in the way of your chg work, and maybe
> why other things in the config won't cause problems?
> 
> pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和 Kevin R.
> Bullock
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to