comparison mercurial/filelog.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 687b865b95ad
children f7b61ad3c64a b994db7c4d1e
comparison
equal deleted inserted replaced
45787:225e513c444e 45788:a5206e71c536
137 self, 137 self,
138 deltas, 138 deltas,
139 linkmapper, 139 linkmapper,
140 transaction, 140 transaction,
141 addrevisioncb=None, 141 addrevisioncb=None,
142 duplicaterevisioncb=None,
142 maybemissingparents=False, 143 maybemissingparents=False,
143 ): 144 ):
144 if maybemissingparents: 145 if maybemissingparents:
145 raise error.Abort( 146 raise error.Abort(
146 _( 147 _(
148 b'parents write mode' 149 b'parents write mode'
149 ) 150 )
150 ) 151 )
151 152
152 return self._revlog.addgroup( 153 return self._revlog.addgroup(
153 deltas, linkmapper, transaction, addrevisioncb=addrevisioncb 154 deltas,
155 linkmapper,
156 transaction,
157 addrevisioncb=addrevisioncb,
158 duplicaterevisioncb=duplicaterevisioncb,
154 ) 159 )
155 160
156 def getstrippoint(self, minlink): 161 def getstrippoint(self, minlink):
157 return self._revlog.getstrippoint(minlink) 162 return self._revlog.getstrippoint(minlink)
158 163