diff mercurial/dagop.py @ 35280:d90c534099b1

filectx: extract helper method to obtain filectx pointing to its introrev
author Yuya Nishihara <yuya@tcha.org>
date Sun, 22 Oct 2017 17:23:34 +0900
parents 0d27685b4a2f
children 70e86db6a913
line wrap: on
line diff
--- a/mercurial/dagop.py	Thu Sep 22 17:16:53 2016 +0900
+++ b/mercurial/dagop.py	Sun Oct 22 17:23:34 2017 +0900
@@ -268,9 +268,7 @@
     `fromline`-`toline` range.
     """
     diffopts = patch.diffopts(fctx._repo.ui)
-    introrev = fctx.introrev()
-    if fctx.rev() != introrev:
-        fctx = fctx.filectx(fctx.filenode(), changeid=introrev)
+    fctx = fctx.introfilectx()
     visit = {(fctx.linkrev(), fctx.filenode()): (fctx, (fromline, toline))}
     while visit:
         c, linerange2 = visit.pop(max(visit))