Skip to content

utils: Add missing relative URL detection in parse_external_definition

External URL definition starting with "^/" can lead to URL not starting with the repository one so handle that case.

Spotted in this sentry issue for origin https://svn.code.sf.net/p/svncmd/scripts.

swh-loader_1                        | [2022-04-20 13:55:30,916: DEBUG/ForkPoolWorker-1] Setting 'svn:externals' property with value '^/../../contools/external_tools/trunk/scm/svn scm/svn
swh-loader_1                        | ^/../../contools/external_tools/trunk/python python
swh-loader_1                        | ^/../../contools/external_tools/trunk/deps deps
swh-loader_1                        | ' on path b'trunk/ToolsExternal'
swh-loader_1                        | [2022-04-20 13:55:30,974: DEBUG/ForkPoolWorker-1] Exporting external http://svn.code.sf.net/p/contools/external_tools/trunk/scm/svn to path b'trunk/ToolsExternal/scm/svn'
swh-loader_1                        | [2022-04-20 13:55:30,975: DEBUG/ForkPoolWorker-1] svn export --depth infinity --ignore-keywords http://svn.code.sf.net/p/contools/external_tools/trunk/scm/svn b'/tmp/swh.loader.svn.ncqn5rfu-127/tmpc7c5vn6j/tmpveju6ru3/scm/svn'
swh-loader_1                        | [2022-04-20 13:58:03,374: DEBUG/ForkPoolWorker-1] Exporting external http://svn.code.sf.net/p/contools/external_tools/trunk/python to path b'trunk/ToolsExternal/python'
swh-loader_1                        | [2022-04-20 13:58:03,374: DEBUG/ForkPoolWorker-1] svn export --depth infinity --ignore-keywords http://svn.code.sf.net/p/contools/external_tools/trunk/python b'/tmp/swh.loader.svn.ncqn5rfu-127/tmpc7c5vn6j/tmpp7ne_60p/python'
swh-loader_1                        | [2022-04-20 13:58:16,307: DEBUG/ForkPoolWorker-1] Exporting external http://svn.code.sf.net/p/contools/external_tools/trunk/deps to path b'trunk/ToolsExternal/deps'
swh-loader_1                        | [2022-04-20 13:58:16,308: DEBUG/ForkPoolWorker-1] svn export --depth infinity --ignore-keywords http://svn.code.sf.net/p/contools/external_tools/trunk/deps b'/tmp/swh.loader.svn.ncqn5rfu-127/tmpc7c5vn6j/tmp_ybbojd3/deps'

Migrated from D7616 (view on Phabricator)

Merge request reports