[Updated] D11262: repair: improve performance of detection of revisions affected by issue6528

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Fri Aug 6 10:57:02 UTC 2021


This revision now requires changes to proceed.
marmoute added a comment.
marmoute requested changes to this revision.


  The overall logic seems fine, but the `affected_chain` cache and the `expected_metadata_len` seems wrong,

INLINE COMMENTS

> rewrite.py:589-590
> +    `affected_chain` is a list containing a single boolean (allowing us to
> +    mutate it from here), which is `True` if any previous revision in its chain
> +    are affected, saving computation of the full text, instead looking at the
> +    current delta. If the current delta does *not* touch the metadata parts we

Should we check if they are affected ? or if they have metadata ? because if we have no diff compared to a revision that has metadata, we do have metadat and might have our parent swapped, unlike the delta base.

> rewrite.py:619-621
> +    # This is the expected size of copy metadata, if present
> +    expected_metadata = b"\1\ncopy: %s\ncopyrev: %s\1\n"
> +    expected_metadata_len = len(expected_metadata % (filename, repo.nullid))

I am confused about this check, why are we using `filename` here ?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D11262/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D11262

To: Alphare, #hg-reviewers, marmoute
Cc: marmoute, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210806/e229ee5e/attachment-0002.html>


More information about the Mercurial-patches mailing list