# HG changeset patch # User Augie Fackler # Date 1533830791 14400 # Node ID 9204445ad54c56a13770c5d93f1afc86e7ef4d0a # Parent ac0a8716001209da5912bd27f019c24ed10209be absorb: port partway to Python 3 Use pycompat.maplist() in the one place that matters and use the default iterator of a dict instead of iterkeys(). Two new tests pass on Python 3. Differential Revision: https://phab.mercurial-scm.org/D4174 diff -r ac0a87160012 -r 9204445ad54c contrib/python3-whitelist --- a/contrib/python3-whitelist Sat Aug 04 21:31:46 2018 -0400 +++ b/contrib/python3-whitelist Thu Aug 09 12:06:31 2018 -0400 @@ -1,4 +1,6 @@ test-abort-checkin.t +test-absorb-phase.t +test-absorb-strip.t test-add.t test-addremove-similar.t test-addremove.t diff -r ac0a87160012 -r 9204445ad54c hgext/absorb.py --- a/hgext/absorb.py Sat Aug 04 21:31:46 2018 -0400 +++ b/hgext/absorb.py Thu Aug 09 12:06:31 2018 -0400 @@ -245,7 +245,7 @@ date = ctx.date() desc = ctx.description() user = ctx.user() - files = set(ctx.files()).union(memworkingcopy.iterkeys()) + files = set(ctx.files()).union(memworkingcopy) store = overlaystore(ctx, memworkingcopy) return context.memctx( repo=ctx.repo(), parents=parents, text=desc, @@ -286,7 +286,7 @@ # following fields are built from fctxs. they exist for perf reason self.contents = [f.data() for f in fctxs] - self.contentlines = map(mdiff.splitnewlines, self.contents) + self.contentlines = pycompat.maplist(mdiff.splitnewlines, self.contents) self.linelog = self._buildlinelog() if self.ui.debugflag: assert self._checkoutlinelog() == self.contents @@ -805,7 +805,7 @@ return False pctx = parents[0] # ctx changes more files (not a subset of memworkingcopy) - if not set(ctx.files()).issubset(set(memworkingcopy.iterkeys())): + if not set(ctx.files()).issubset(set(memworkingcopy)): return False for path, content in memworkingcopy.iteritems(): if path not in pctx or path not in ctx: