Page MenuHomeSoftware Heritage

fix the top-level directory path of imported CVS modules
ClosedPublic

Authored by stsp on Dec 8 2021, 9:49 AM.

Details

Summary

CVS modules were imported with the a top-level directory which
matched the module name. For a CVS origin such as
rsync://cvs.savannah.gnu.org/sources/dino/dino
the top-level directory contained a single directory called "dino"
with all expected files and directories residing inside this directory.
E.g. the dino project's top-level README file would be stored at
the path "dino/README" instead of just "/README".

Import project files directly into the top-level directory, as expected.
Adjust test expectations accordingly.

Diff Detail

Repository
rDLDCVS CVS 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 D6781 (id=24605)

Rebasing onto 9e8f931ef7...

Current branch diff-target is up to date.
Changes applied before test
commit 965629d6c8b3696750d596e0fe923ec87c0eccf9
Author: Stefan Sperling <stsp@stsp.name>
Date:   Wed Dec 8 09:21:34 2021 +0100

    fix the top-level directory path of imported CVS modules
    
    CVS modules were imported with the a top-level directory which
    matched the module name. For a CVS origin such as
    rsync://cvs.savannah.gnu.org/sources/dino/dino
    the top-level directory contained a single directory called "dino"
    with all expected files and directories residing inside this directory.
    E.g. the dino project's top-level README file would be stored at
    the path "dino/README" instead of just "/README".
    
    Import project files directly into the top-level directory, as expected.
    Adjust test expectations accordingly.

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

stsp requested review of this revision.Dec 8 2021, 10:01 AM
ardumont added a subscriber: ardumont.

lgtm

One question inline.

swh/loader/cvs/loader.py
294

To answer this, the assertion you did on the right is exactly how we tell mypy "it's ok" :)

swh/loader/cvs/tests/test_loader.py
148

Any idea as to why there is so much difference (i would have expected minus 1 like the other test above)?

Did by any chance the previous version load too much things out of the top-level directory (some other temp directory or something)?

This revision is now accepted and ready to land.Dec 8 2021, 10:25 AM
swh/loader/cvs/tests/test_loader.py
148

This test loads 7 revisions in total. We now create one less directory per revision, so this difference is expected.

swh/loader/cvs/tests/test_loader.py
148

ah yes, indeed, thanks!