This is an archive of the discontinued Mercurial Phabricator instance.

dagutil: use a listcomp instead of a map()
ClosedPublic

Authored by durin42 on Oct 15 2017, 9:30 PM.

Details

Summary

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.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

durin42 created this revision.Oct 15 2017, 9:30 PM
ryanmce accepted this revision.Oct 16 2017, 5:15 AM
ryanmce added a subscriber: ryanmce.

queued

This revision is now accepted and ready to land.Oct 16 2017, 5:15 AM
This revision was automatically updated to reflect the committed changes.
yuja added a subscriber: yuja.Oct 17 2017, 10:35 AM

I have no preference, but pycompat.maplist() could be used.

Oh, I always forget maplist() exists. Probably doesn't matter for this case.