diff mercurial/changegroup.py @ 39181:0a934ee94f09

dagop: port revlogdag.linearize() to standalone function The code should functionally be identical. We also port the one consumer in changegroup to use the new standalone function. After this commit, dagutil is no longer used! Differential Revision: https://phab.mercurial-scm.org/D4329
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 17 Aug 2018 21:21:50 +0000
parents 0b5f534df82a
children 2646b8d66b7b
line wrap: on
line diff
--- a/mercurial/changegroup.py	Fri Aug 17 19:48:52 2018 +0000
+++ b/mercurial/changegroup.py	Fri Aug 17 21:21:50 2018 +0000
@@ -24,7 +24,7 @@
 )
 
 from . import (
-    dagutil,
+    dagop,
     error,
     match as matchmod,
     mdiff,
@@ -587,8 +587,8 @@
     # for generaldelta revlogs, we linearize the revs; this will both be
     # much quicker and generate a much smaller bundle
     if (store._generaldelta and reorder is None) or reorder:
-        dag = dagutil.revlogdag(store)
-        return dag.linearize(set(store.rev(n) for n in nodes))
+        revs = set(store.rev(n) for n in nodes)
+        return dagop.linearize(revs, store.parentrevs)
     else:
         return sorted([store.rev(n) for n in nodes])