##// END OF EJS Templates
sidedata: add a `decode_files_sidedata` function...
marmoute -
r46145:7543b507 default
parent child Browse files
Show More
@@ -306,13 +306,16 b' class changelogrevision(object):'
306 def changes(self):
306 def changes(self):
307 if self._changes is not None:
307 if self._changes is not None:
308 return self._changes
308 return self._changes
309 changes = metadata.ChangingFiles(
309 if self._cpsd:
310 touched=self.files or (),
310 changes = metadata.decode_files_sidedata(self, self._sidedata)
311 added=self.filesadded or (),
311 else:
312 removed=self.filesremoved or (),
312 changes = metadata.ChangingFiles(
313 p1_copies=self.p1copies or {},
313 touched=self.files or (),
314 p2_copies=self.p2copies or {},
314 added=self.filesadded or (),
315 )
315 removed=self.filesremoved or (),
316 p1_copies=self.p1copies or {},
317 p2_copies=self.p2copies or {},
318 )
316 self._changes = changes
319 self._changes = changes
317 return changes
320 return changes
318
321
@@ -342,6 +342,32 b' def encode_files_sidedata(files):'
342 return sidedata
342 return sidedata
343
343
344
344
345 def decode_files_sidedata(changelogrevision, sidedata):
346 """Return a ChangingFiles instance from a changelogrevision using sidata
347 """
348 touched = changelogrevision.files
349
350 rawindices = sidedata.get(sidedatamod.SD_FILESADDED)
351 added = decodefileindices(touched, rawindices)
352
353 rawindices = sidedata.get(sidedatamod.SD_FILESREMOVED)
354 removed = decodefileindices(touched, rawindices)
355
356 rawcopies = sidedata.get(sidedatamod.SD_P1COPIES)
357 p1_copies = decodecopies(touched, rawcopies)
358
359 rawcopies = sidedata.get(sidedatamod.SD_P2COPIES)
360 p2_copies = decodecopies(touched, rawcopies)
361
362 return ChangingFiles(
363 touched=touched,
364 added=added,
365 removed=removed,
366 p1_copies=p1_copies,
367 p2_copies=p2_copies,
368 )
369
370
345 def _getsidedata(srcrepo, rev):
371 def _getsidedata(srcrepo, rev):
346 ctx = srcrepo[rev]
372 ctx = srcrepo[rev]
347 filescopies = computechangesetcopies(ctx)
373 filescopies = computechangesetcopies(ctx)
General Comments 0
You need to be logged in to leave comments. Login now