Page MenuHomeSoftware Heritage

replay: Robustify external path removal implementation
ClosedPublic

Authored by anlambert on Jan 21 2022, 5:05 PM.

Details

Summary

When removing the subpaths of an external path, we first need to check
if a subpath is not versioned instead of checking if it is empty.

If a subpath is versioned, we can stop the paths removal process.

Relate to T3870

Fixes SWH-LOADER-SVN-53, SWH-LOADER-SVN-55 and SWH-LOADER-SVN-57.

Depends on D7015

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 D7017 (id=25436)

Could not rebase; Attempt merge onto e6e733005d...

Updating e6e7330..4568f71
Fast-forward
 swh/loader/svn/replay.py            |  15 ++--
 swh/loader/svn/tests/test_loader.py | 150 ++++++++++++++++++++++++++++++++++++
 2 files changed, 160 insertions(+), 5 deletions(-)
Changes applied before test
commit 4568f71b9836a5d4ffdfddbd07d1e20b0cbb1c60
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Fri Jan 21 17:01:01 2022 +0100

    replay: Robustify external path removal implementation
    
    When removing the subpaths of an external path, we first need to check
    if a subpath is not versioned instead of checking if it is empty.
    
    If a subpath is versioned, we can stop the paths removal process.
    
    Relate to T3870

commit eb34b0c059ea91d2a2d6a91194c3b70eb7bdc546
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Fri Jan 21 16:30:14 2022 +0100

    replay: Use peg_rev parameter of client.export instead of rev
    
    It exist cases where there is an ambiguity for subversion to export a path
    from a given revision.
    
    See https://edoras.sdsu.edu/doc/svn-book-html-chunk/svn.advanced.pegrevs.html
    for more details.
    
    To remove the ambiguity, the peg_rev parameter of the export operation must
    be used instead of the rev one.
    
    Related to T3870

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

This revision is now accepted and ready to land.Jan 21 2022, 6:19 PM