Page MenuHomeSoftware Heritage

ra: Fix error when processing svn link on directory
ClosedPublic

Authored by anlambert on Dec 2 2021, 1:39 PM.

Details

Summary

When a svn link targets a directory, ensure to not read the
associated path to avoid IsADirectoryError being raised.

This fixes SWH-LOADER-SVN-4B.

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 D6726 (id=24444)

Rebasing onto 90decdc134...

Current branch diff-target is up to date.
Changes applied before test
commit d8c5e8095fd4151bf9ea214e2e4ccd4ef18a59ca
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Dec 2 13:37:16 2021 +0100

    ra: Fix error when processing svn link on directory
    
    When a svn link targets a directory, ensure to not read the
    associated path to avoid IsADirectoryError being raised.

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

ardumont added subscribers: stsp, ardumont.

lgtm


@stsp by the way, you might be interested by this kind of diff. This shows how to
actually change the behavior and the associated test to check it (if you drop the fixed
behavior, the new test fails with the error it fixes).

@anlambert did some recent improvment to define a readable/understandable DSL over svn
commit to prepare a repo in the state we want to check (instead of relying on a bare
existing svn repository with the equivalent state [1]).

[1] That was how were defined the initial tests and well, that 1. takes space and 2.
it's not immediately clear what the state of the tested repository is so we need to
clarify in test docstring somehow (and well that duplicates the info but that can go out
of sync at some point).

That's just a heads up.

Cheers,

This revision is now accepted and ready to land.Dec 2 2021, 2:11 PM