Mercurial > public > mercurial-scm > hg
comparison mercurial/dagutil.py @ 34728:09397d0dd3b7
dagutil: use a listcomp instead of a map()
In Python 3, the map() returns a generator object instead of a list,
and some parts of hg depend on this being consumable more than once or
sortable in place.
Differential Revision: https://phab.mercurial-scm.org/D1099
author | Augie Fackler <augie@google.com> |
---|---|
date | Sun, 15 Oct 2017 00:37:24 -0400 |
parents | 015ded095933 |
children | f77121b6bf1b |
comparison
equal
deleted
inserted
replaced
34727:a652b7763f66 | 34728:09397d0dd3b7 |
---|---|
146 if filterunknown: | 146 if filterunknown: |
147 return [r for r in map(rl.nodemap.get, ids) | 147 return [r for r in map(rl.nodemap.get, ids) |
148 if (r is not None | 148 if (r is not None |
149 and r != nullrev | 149 and r != nullrev |
150 and r not in rl.filteredrevs)] | 150 and r not in rl.filteredrevs)] |
151 return map(self._internalize, ids) | 151 return [self._internalize(i) for i in ids] |
152 | 152 |
153 | 153 |
154 class revlogdag(revlogbaseddag): | 154 class revlogdag(revlogbaseddag): |
155 '''dag interface to a revlog''' | 155 '''dag interface to a revlog''' |
156 | 156 |