D1099: dagutil: use a listcomp instead of a map()
durin42 (Augie Fackler)
phabricator at mercurial-scm.org
Mon Oct 16 01:30:45 UTC 2017
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION 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.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D1099
AFFECTED FILES
mercurial/dagutil.py
CHANGE DETAILS
diff --git a/mercurial/dagutil.py b/mercurial/dagutil.py
--- a/mercurial/dagutil.py
+++ b/mercurial/dagutil.py
@@ -148,7 +148,7 @@
if (r is not None
and r != nullrev
and r not in rl.filteredrevs)]
- return map(self._internalize, ids)
+ return [self._internalize(i) for i in ids]
class revlogdag(revlogbaseddag):
To: durin42, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list