Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/svn/utils.py
Show First 20 Lines • Show All 282 Lines • ▼ Show 20 Lines | for external_part in external.split(): | ||||
if path.startswith("./"): | if path.startswith("./"): | ||||
path = path.replace("./", "", 1) | path = path.replace("./", "", 1) | ||||
prev_part = external_part | prev_part = external_part | ||||
if "@" in external_url: | if "@" in external_url: | ||||
# try to extract revision number if external URL is in the form | # try to extract revision number if external URL is in the form | ||||
# http://svn.example.org/repos/test/path@XXX | # http://svn.example.org/repos/test/path@XXX | ||||
url, revision_s = external_url.rsplit("@", maxsplit=1) | url, revision_s = external_url.rsplit("@", maxsplit=1) | ||||
try: | try: | ||||
revision = int(revision_s) | # ensure revision_s can be parsed to int | ||||
rev = int(revision_s) | |||||
# -r XXX takes priority over <svn_url>@XXX | |||||
revision = revision or rev | |||||
external_url = url | external_url = url | ||||
except ValueError: | except ValueError: | ||||
# handle URL like http://user@svn.example.org/ | # handle URL like http://user@svn.example.org/ | ||||
pass | pass | ||||
return (path.rstrip("/"), external_url, revision, relative_url) | return (path.rstrip("/"), external_url, revision, relative_url) | ||||
def is_recursive_external( | def is_recursive_external( | ||||
Show All 23 Lines |