# HG changeset patch # User Denis Laxalde # Date 1484583276 -3600 # Node ID 0e07855e6054b4fcdd167f74a9cb5621eeb3c082 # Parent 21f1f97ab2123c27b2d09b9f9dc2e68af3fe10a9 context: also return ancestor's line range in blockancestors diff -r 21f1f97ab212 -r 0e07855e6054 mercurial/context.py --- a/mercurial/context.py Mon Jan 16 17:08:25 2017 +0100 +++ b/mercurial/context.py Mon Jan 16 17:14:36 2017 +0100 @@ -1179,7 +1179,7 @@ pl = pl[:1] if not pl: # The block originates from the initial revision. - yield c + yield c, linerange2 continue inrange = False for p in pl: @@ -1192,7 +1192,7 @@ continue visit[p.linkrev(), p.filenode()] = p, linerange1 if inrange: - yield c + yield c, linerange2 class committablectx(basectx): """A committablectx object provides common functionality for a context that diff -r 21f1f97ab212 -r 0e07855e6054 mercurial/revset.py --- a/mercurial/revset.py Mon Jan 16 17:08:25 2017 +0100 +++ b/mercurial/revset.py Mon Jan 16 17:14:36 2017 +0100 @@ -952,7 +952,8 @@ fromline -= 1 fctx = repo[rev].filectx(fname) - revs = (c.rev() for c in context.blockancestors(fctx, fromline, toline)) + revs = (c.rev() for c, _linerange + in context.blockancestors(fctx, fromline, toline)) return subset & generatorset(revs, iterasc=False) @predicate('all()', safe=True)