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