Mercurial > hg
comparison mercurial/changegroup.py @ 24977:4289383cb9d2
changegroup: document the cases where reordering complicates linkrevs
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 29 Apr 2015 13:25:07 -0700 |
parents | 147d8892fc4b |
children | f52560c64953 |
comparison
equal
deleted
inserted
replaced
24976:147d8892fc4b | 24977:4289383cb9d2 |
---|---|
383 for chunk in self.group(clnodes, cl, lookupcl, units=_('changesets')): | 383 for chunk in self.group(clnodes, cl, lookupcl, units=_('changesets')): |
384 size += len(chunk) | 384 size += len(chunk) |
385 yield chunk | 385 yield chunk |
386 self._verbosenote(_('%8.i (changelog)\n') % size) | 386 self._verbosenote(_('%8.i (changelog)\n') % size) |
387 | 387 |
388 # We need to make sure that the linkrev in the changegroup refers to | |
389 # the first changeset that introduced the manifest or file revision. | |
390 # The fastpath is usually safer than the slowpath, because the filelogs | |
391 # are walked in revlog order. | |
392 # | |
393 # When taking the slowpath with reorder=None and the manifest revlog | |
394 # uses generaldelta, the manifest may be walked in the "wrong" order. | |
395 # Without 'clrevorder', we would get an incorrect linkrev (see fix in | |
396 # cc0ff93d0c0c). | |
397 # | |
398 # When taking the fastpath, we are only vulnerable to reordering | |
399 # of the changelog itself. The changelog never uses generaldelta, so | |
400 # it is only reordered when reorder=True. To handle this case, we | |
401 # simply take the slowpath, which already has the 'clrevorder' logic. | |
402 # This was also fixed in cc0ff93d0c0c. | |
388 fastpathlinkrev = fastpathlinkrev and not self._reorder | 403 fastpathlinkrev = fastpathlinkrev and not self._reorder |
389 # Callback for the manifest, used to collect linkrevs for filelog | 404 # Callback for the manifest, used to collect linkrevs for filelog |
390 # revisions. | 405 # revisions. |
391 # Returns the linkrev node (collected in lookupcl). | 406 # Returns the linkrev node (collected in lookupcl). |
392 def lookupmf(x): | 407 def lookupmf(x): |