Mercurial > hg
comparison mercurial/interfaces/repository.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 | 2d6aea053153 |
children | 89a2afe31e82 |
comparison
equal
deleted
inserted
replaced
45787:225e513c444e | 45788:a5206e71c536 |
---|---|
754 def addgroup( | 754 def addgroup( |
755 deltas, | 755 deltas, |
756 linkmapper, | 756 linkmapper, |
757 transaction, | 757 transaction, |
758 addrevisioncb=None, | 758 addrevisioncb=None, |
759 duplicaterevisioncb=None, | |
759 maybemissingparents=False, | 760 maybemissingparents=False, |
760 ): | 761 ): |
761 """Process a series of deltas for storage. | 762 """Process a series of deltas for storage. |
762 | 763 |
763 ``deltas`` is an iterable of 7-tuples of | 764 ``deltas`` is an iterable of 7-tuples of |
1245 """Produce ``irevisiondelta`` describing revisions. | 1246 """Produce ``irevisiondelta`` describing revisions. |
1246 | 1247 |
1247 See the documentation for ``ifiledata`` for more. | 1248 See the documentation for ``ifiledata`` for more. |
1248 """ | 1249 """ |
1249 | 1250 |
1250 def addgroup(deltas, linkmapper, transaction, addrevisioncb=None): | 1251 def addgroup( |
1252 deltas, | |
1253 linkmapper, | |
1254 transaction, | |
1255 addrevisioncb=None, | |
1256 duplicaterevisioncb=None, | |
1257 ): | |
1251 """Process a series of deltas for storage. | 1258 """Process a series of deltas for storage. |
1252 | 1259 |
1253 See the documentation in ``ifilemutation`` for more. | 1260 See the documentation in ``ifilemutation`` for more. |
1254 """ | 1261 """ |
1255 | 1262 |