Page MenuHomeSoftware Heritage

Fix context for the first revision in a run
ClosedPublic

Authored by Alphare on Dec 2 2021, 10:35 AM.

Details

Summary

See inline comments: in essence, currently the first revision
in a run (incremental or not) will get the null revision as a
parent and no cached directory, which creates the wrong diff for that
revision (i.e. lots of files become added etc).

We fix this problem by doing a full listing of the first revision
in a run.

Diff Detail

Repository
rDLDHG Mercurial loader
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D6723 (id=24415)

Could not rebase; Attempt merge onto e0ce7f8e66...

Updating e0ce7f8..8ac42a9
Fast-forward
 swh/loader/mercurial/loader.py | 63 +++++++++++++++++++++++++++++++-----------
 1 file changed, 47 insertions(+), 16 deletions(-)
Changes applied before test
commit 8ac42a9a22b72b8c2999656c31e9641e2c43aac2
Author: Raphaël Gomès <rgomes@octobus.net>
Date:   Wed Dec 1 18:11:16 2021 +0100

    Fix context for the first revision in a run
    
    See inline comments: in essence, currently the first revision
    in a run (incremental or not) will get the null revision as a
    parent and no cached directory, which creates the wrong diff for that
    revision (i.e. lots of files become added etc).
    
    We fix this problem by doing a full listing of the first revision
    in a run.

commit 6f1ef81f688fa4f3d3f7ee90337d5569a7474f20
Author: Raphaël Gomès <rgomes@octobus.net>
Date:   Wed Dec 1 18:05:28 2021 +0100

    Don't accidentally do a full run on incremental
    
    Filtering against the storage then asking for new revisions only makes
    sense if there are revisions not in storage and not ancestors of heads.
    If there are none, the current behavior lists all revisions, which is a
    whole lot of wasted work.

See https://jenkins.softwareheritage.org/job/DLDHG/job/tests-on-diff/323/ for more details.

This revision is now accepted and ready to land.Dec 2 2021, 10:39 AM