Page MenuHomeSoftware Heritage

rlog, cvs2gitdump: Fix handling of revision number greater than one
ClosedPublic

Authored by anlambert on Jul 8 2022, 6:19 PM.

Details

Reviewers
ardumont
Group Reviewers
Reviewers
Maniphest Tasks
Restricted Maniphest Task
Commits
rDLDCVS386a68f1498f: rlog, cvs2gitdump: Fix handling of revision number greater than one
Summary

It exists CVS respositories where revision numbers greather than 1.x
are used to version files.

Previous loader implementation was raising an error when encountering
such kind of revision so ensure it will be processed as the other ones.

Also fix tag names extraction from rlog output.

Related to T4043

Fixes SWH-LOADER-CVS-4 and SWH-LOADER-CVS-6

Test Plan

I added a loading test for a lighweight CVS repo with such revision
numbers in its changesets.

I also compared the snapshot obtained with the git cvsimport command and
the one obtained by the loader: the exact same set of revisions are generated.

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 D8103 (id=29256)

Rebasing onto e5215cf198...

Current branch diff-target is up to date.
Changes applied before test
commit 94ea5f5ccf1ff76b87d2db36df092711bcd7b1c4
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Fri Jul 8 18:12:07 2022 +0200

    rlog, cvs2gitdump: Fix handling of revision number greater than one
    
    It exists CVS respositories where revision numbers greather than 1.x
    are used to version files.
    
    Previous loader implementation was raising an error when encountering
    such kind of revision so ensure it will be processed as the other ones.
    
    Related to T4043

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

Build is green

Patch application report for D8103 (id=29257)

Rebasing onto e5215cf198...

Current branch diff-target is up to date.
Changes applied before test
commit c8525164a0c089f2078921e035d824e9b707f8a9
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Fri Jul 8 18:12:07 2022 +0200

    rlog, cvs2gitdump: Fix handling of revision number greater than one
    
    It exists CVS respositories where revision numbers greather than 1.x
    are used to version files.
    
    Previous loader implementation was raising an error when encountering
    such kind of revision so ensure it will be processed as the other ones.
    
    Also fix tag names extraction from rlog output.
    
    Related to T4043

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

Build is green

Patch application report for D8103 (id=29258)

Rebasing onto e5215cf198...

Current branch diff-target is up to date.
Changes applied before test
commit ef959a9e6560390cbbc377faabbf2928d3471b62
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Fri Jul 8 18:12:07 2022 +0200

    rlog, cvs2gitdump: Fix handling of revision number greater than one
    
    It exists CVS respositories where revision numbers greather than 1.x
    are used to version files.
    
    Previous loader implementation was raising an error when encountering
    such kind of revision so ensure it will be processed as the other ones.
    
    Also fix tag names extraction from rlog output.
    
    Related to T4043

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

Build is green

Patch application report for D8103 (id=29259)

Rebasing onto e5215cf198...

Current branch diff-target is up to date.
Changes applied before test
commit 10c4a100f9cb186c3b90fa68edd84673ba089050
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Fri Jul 8 18:12:07 2022 +0200

    rlog, cvs2gitdump: Fix handling of revision number greater than one
    
    It exists CVS respositories where revision numbers greather than 1.x
    are used to version files.
    
    Previous loader implementation was raising an error when encountering
    such kind of revision so ensure it will be processed as the other ones.
    
    Also fix tag names extraction from rlog output.
    
    Related to T4043

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

ardumont added inline comments.
swh/loader/cvs/rlog.py
129

not on you but i have a hard time reading the what the k and v_ variables stand for...

320

are those last 2 changes the same as before though?

swh/loader/cvs/rlog.py
129

I thought about renaming these loop variables (plus the two others in other loop below) but I wanted to keep that diff small and readable.
I intend to do it in another diff.

320

They are related yes, I found that issue while discovering the taginfo dict in the code above was always empty even for repositories with tags.
I added a sentence in commit message for that fix.

This revision is now accepted and ready to land.Jul 11 2022, 2:20 PM

Build is green

Patch application report for D8103 (id=29273)

Rebasing onto 5a79a325a8...

Current branch diff-target is up to date.
Changes applied before test
commit 386a68f1498fb796b5334a392b100a6e81f9edcc
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Fri Jul 8 18:12:07 2022 +0200

    rlog, cvs2gitdump: Fix handling of revision number greater than one
    
    It exists CVS respositories where revision numbers greather than 1.x
    are used to version files.
    
    Previous loader implementation was raising an error when encountering
    such kind of revision so ensure it will be processed as the other ones.
    
    Also fix tag names extraction from rlog output.
    
    Related to T4043

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