diff mercurial/manifest.py @ 45788:a5206e71c536

revlog: extend addgroup() with callback for duplicates The addgroup() interface currently doesn't allow the caller to keep track of duplicated nodes except by looking at the returned node list. Add an optional second callback for this purpose and change the return type to a boolean. This allows follow-up changes to use more efficient storage for the node list in places that are memory-sensitive. Differential Revision: https://phab.mercurial-scm.org/D9231
author Joerg Sonnenberger <joerg@bec.de>
date Sun, 18 Oct 2020 22:18:02 +0200
parents ff59af8395a5
children 89a2afe31e82
line wrap: on
line diff
--- a/mercurial/manifest.py	Wed Oct 07 14:26:47 2020 +0530
+++ b/mercurial/manifest.py	Sun Oct 18 22:18:02 2020 +0200
@@ -1832,9 +1832,20 @@
             deltamode=deltamode,
         )
 
-    def addgroup(self, deltas, linkmapper, transaction, addrevisioncb=None):
+    def addgroup(
+        self,
+        deltas,
+        linkmapper,
+        transaction,
+        addrevisioncb=None,
+        duplicaterevisioncb=None,
+    ):
         return self._revlog.addgroup(
-            deltas, linkmapper, transaction, addrevisioncb=addrevisioncb
+            deltas,
+            linkmapper,
+            transaction,
+            addrevisioncb=addrevisioncb,
+            duplicaterevisioncb=duplicaterevisioncb,
         )
 
     def rawsize(self, rev):