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

login
register
mail settings
Submitter Yuya Nishihara
Date Dec. 6, 2017, 3:05 p.m.
Message ID <1977b7f3214c612d62e0.1512572749@mimosa>
Download mbox | patch
Permalink /patch/25974/
State Accepted
Headers show

Comments

Yuya Nishihara - Dec. 6, 2017, 3:05 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@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.

Patch

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))