[PATCH 5 of 8] dagop: use fctx.rev() consistently in filectxancestors()

Yuya Nishihara yuya at tcha.org
Wed Dec 6 10:05:49 EST 2017


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1474534915 -32400
#      Thu Sep 22 18:01:55 2016 +0900
# Node ID 1977b7f3214c612d62e099f6984fae086adcc69c
# Parent  383d767942609ea0c7fe1a12abbdf0063d8f7f80
dagop: use fctx.rev() consistently in filectxancestors()

We can't use fctx.linkrev() to sort fctxs coming from multiple files.
This was changed at 24b57c3899f8 due to performance issue, but we know
we evaluate parent.rev() in revset anyway.

diff --git a/mercurial/dagop.py b/mercurial/dagop.py
--- a/mercurial/dagop.py
+++ b/mercurial/dagop.py
@@ -87,7 +87,7 @@ def filectxancestors(fctx, followfirst=F
     yield c
     while True:
         for parent in c.parents()[:cut]:
-            visit[(parent.linkrev(), parent.filenode())] = parent
+            visit[(parent.rev(), parent.filenode())] = parent
         if not visit:
             break
         c = visit.pop(max(visit))


More information about the Mercurial-devel mailing list