[PATCH 4 of 4] phase: remove a 'for x in "foo bar".split()' idioms in phasecache.replace
Laurent Charignon
lcharignon at fb.com
Wed Jun 17 17:44:06 UTC 2015
This series of patches looks good to me.
Thanks for doing that Pierre-Yves!
> On Jun 16, 2015, at 7:09 PM, Pierre-Yves David <pierre-yves.david at ens-lyon.org> wrote:
>
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at fb.com>
> # Date 1434409577 25200
> # Mon Jun 15 16:06:17 2015 -0700
> # Node ID 224d65155c89858817fdf2dc48402dc3519fb117
> # Parent 18cc713258b6240bc0543aa5ceb537a80a8a85e5
> phase: remove a 'for x in "foo bar".split()' idioms in phasecache.replace
>
> I find this idioms fairly horrible.
>
> diff --git a/mercurial/phases.py b/mercurial/phases.py
> --- a/mercurial/phases.py
> +++ b/mercurial/phases.py
> @@ -170,11 +170,11 @@ class phasecache(object):
> ph._phasesets = self._phasesets
> return ph
>
> def replace(self, phcache):
> """replace all values in 'self' with content of phcache"""
> - for a in 'phaseroots dirty opener _phaserevs _phasesets'.split():
> + for a in ('phaseroots', 'dirty', 'opener', '_phaserevs', '_phasesets'):
> setattr(self, a, getattr(phcache, a))
>
> def _getphaserevsnative(self, repo):
> repo = repo.unfiltered()
> nativeroots = []
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
More information about the Mercurial-devel
mailing list