Page MenuHomeSoftware Heritage

Small code improvements for the svn loader
ClosedPublic

Authored by anlambert on Dec 14 2021, 5:53 PM.

Details

Summary

That diff combines four commits bringing small code improvements to
the subversion loader.

commit c56712550aa4597935e9798bceefb5c8e7b8a860 (svn-loader-small-improvements)
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Dec 8 19:26:13 2021 +0100

    loader: Simplify fetch_data implementation

commit f069043f70901218c13fcf08883e3f9c9e56617e
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Dec 8 17:23:22 2021 +0100

    ra: Add debug logging when setting svn:externals property on a path
    
    Related to T611

commit 6a889e041a4039b8c2a213e8b0146a48fe10b233
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Dec 8 13:40:58 2021 +0100

    ra: Add path parameter to DirEditor
    
    It enables to get the path of the currently processed directory
    which can be useful for logging and future improvements of the
    loader (svn:externals property support for instance).
    
    Related to T611

commit f6f0c5bb3703ea1b2ba271eca43e64b51948c6d2
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Dec 8 11:55:04 2021 +0100

    ra: Merge BaseDirEditor and DirEditor into a single DirEditor class
    
    DirEditor being the only class derived from the BaseDirEditor one,
    let's merge their code into a single DirEditor class.

Related to T611

Diff Detail

Repository
rDLDSVN Subversion (SVN) 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 D6838 (id=24785)

Rebasing onto 0ae91422d8...

Current branch diff-target is up to date.
Changes applied before test
commit c56712550aa4597935e9798bceefb5c8e7b8a860
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Dec 8 19:26:13 2021 +0100

    loader: Simplify fetch_data implementation

commit f069043f70901218c13fcf08883e3f9c9e56617e
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Dec 8 17:23:22 2021 +0100

    ra: Add debug logging when setting svn:externals property on a path
    
    Related to T611

commit 6a889e041a4039b8c2a213e8b0146a48fe10b233
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Dec 8 13:40:58 2021 +0100

    ra: Add path parameter to DirEditor
    
    It enables to get the path of the currently processed directory
    which can be useful for logging and future improvements of the
    loader (svn:externals property support for instance).
    
    Related to T611

commit f6f0c5bb3703ea1b2ba271eca43e64b51948c6d2
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Dec 8 11:55:04 2021 +0100

    ra: Merge BaseDirEditor and DirEditor into a single DirEditor class
    
    DirEditor being the only class derived from the BaseDirEditor one,
    let's merge their code into a single DirEditor class.

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

ardumont added a subscriber: ardumont.

lgtm

(especially since tests are good too)

swh/loader/svn/ra.py
433

I'm not sure i get the instantiation here vs the old implementation which returned self instead (then again, i don't recall why that was defined that way at the time...)

This revision is now accepted and ready to land.Dec 14 2021, 6:02 PM
swh/loader/svn/ra.py
433

We instantiate a new DirEditorclass here in order to pass the new path parameter to the constructor.

It is needed to properly process externals definitions as we did not have the path of the directory previously only the root one.