diff -r 51fdedd29b0a -r a457da5296a5 mercurial/context.py --- a/mercurial/context.py Mon Apr 24 17:13:24 2017 +0200 +++ b/mercurial/context.py Mon Apr 24 18:33:23 2017 +0200 @@ -1214,6 +1214,10 @@ # introduced in this revision; no need to go futher in this # branch. continue + # Set _descendantrev with 'c' (a known descendant) so that, when + # _adjustlinkrev is called for 'p', it receives this descendant + # (as srcrev) instead possibly topmost introrev. + p._descendantrev = c.rev() visit[p.linkrev(), p.filenode()] = p, linerange1 if inrange: yield c, linerange2