Show More
@@ -215,9 +215,10 b' class changelogrevision(object):' | |||
|
215 | 215 | r'_offsets', |
|
216 | 216 | r'_text', |
|
217 | 217 | r'_sidedata', |
|
218 | r'_cpsd', | |
|
218 | 219 | ) |
|
219 | 220 | |
|
220 | def __new__(cls, text, sidedata): | |
|
221 | def __new__(cls, text, sidedata, cpsd): | |
|
221 | 222 | if not text: |
|
222 | 223 | return _changelogrevision(extra=_defaultextra) |
|
223 | 224 | |
@@ -250,6 +251,7 b' class changelogrevision(object):' | |||
|
250 | 251 | self._offsets = (nl1, nl2, nl3, doublenl) |
|
251 | 252 | self._text = text |
|
252 | 253 | self._sidedata = sidedata |
|
254 | self._cpsd = cpsd | |
|
253 | 255 | |
|
254 | 256 | return self |
|
255 | 257 | |
@@ -308,8 +310,10 b' class changelogrevision(object):' | |||
|
308 | 310 | |
|
309 | 311 | @property |
|
310 | 312 | def filesadded(self): |
|
311 | if sidedatamod.SD_FILESADDED in self._sidedata: | |
|
313 | if self._cpsd: | |
|
312 | 314 | rawindices = self._sidedata.get(sidedatamod.SD_FILESADDED) |
|
315 | if not rawindices: | |
|
316 | return [] | |
|
313 | 317 | else: |
|
314 | 318 | rawindices = self.extra.get(b'filesadded') |
|
315 | 319 | if rawindices is None: |
@@ -318,8 +322,10 b' class changelogrevision(object):' | |||
|
318 | 322 | |
|
319 | 323 | @property |
|
320 | 324 | def filesremoved(self): |
|
321 | if sidedatamod.SD_FILESREMOVED in self._sidedata: | |
|
325 | if self._cpsd: | |
|
322 | 326 | rawindices = self._sidedata.get(sidedatamod.SD_FILESREMOVED) |
|
327 | if not rawindices: | |
|
328 | return [] | |
|
323 | 329 | else: |
|
324 | 330 | rawindices = self.extra.get(b'filesremoved') |
|
325 | 331 | if rawindices is None: |
@@ -328,8 +334,10 b' class changelogrevision(object):' | |||
|
328 | 334 | |
|
329 | 335 | @property |
|
330 | 336 | def p1copies(self): |
|
331 | if sidedatamod.SD_P1COPIES in self._sidedata: | |
|
337 | if self._cpsd: | |
|
332 | 338 | rawcopies = self._sidedata.get(sidedatamod.SD_P1COPIES) |
|
339 | if not rawcopies: | |
|
340 | return {} | |
|
333 | 341 | else: |
|
334 | 342 | rawcopies = self.extra.get(b'p1copies') |
|
335 | 343 | if rawcopies is None: |
@@ -338,8 +346,10 b' class changelogrevision(object):' | |||
|
338 | 346 | |
|
339 | 347 | @property |
|
340 | 348 | def p2copies(self): |
|
341 | if sidedatamod.SD_P2COPIES in self._sidedata: | |
|
349 | if self._cpsd: | |
|
342 | 350 | rawcopies = self._sidedata.get(sidedatamod.SD_P2COPIES) |
|
351 | if not rawcopies: | |
|
352 | return {} | |
|
343 | 353 | else: |
|
344 | 354 | rawcopies = self.extra.get(b'p2copies') |
|
345 | 355 | if rawcopies is None: |
@@ -581,13 +591,18 b' class changelog(revlog.revlog):' | |||
|
581 | 591 | ``changelogrevision`` instead, as it is faster for partial object |
|
582 | 592 | access. |
|
583 | 593 | """ |
|
584 |
|
|
|
594 | d, s = self._revisiondata(node) | |
|
595 | c = changelogrevision( | |
|
596 | d, s, self._copiesstorage == b'changeset-sidedata' | |
|
597 | ) | |
|
585 | 598 | return (c.manifest, c.user, c.date, c.files, c.description, c.extra) |
|
586 | 599 | |
|
587 | 600 | def changelogrevision(self, nodeorrev): |
|
588 | 601 | """Obtain a ``changelogrevision`` for a node or revision.""" |
|
589 | 602 | text, sidedata = self._revisiondata(nodeorrev) |
|
590 |
return changelogrevision( |
|
|
603 | return changelogrevision( | |
|
604 | text, sidedata, self._copiesstorage == b'changeset-sidedata' | |
|
605 | ) | |
|
591 | 606 | |
|
592 | 607 | def readfiles(self, node): |
|
593 | 608 | """ |
General Comments 0
You need to be logged in to leave comments.
Login now