Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/svn/utils.py
Show First 20 Lines • Show All 273 Lines • ▼ Show 20 Lines | for external_part in external.split(): | ||||
path = next(iter([e for e in external_split if e.startswith(path_prefix)])) | path = next(iter([e for e in external_split if e.startswith(path_prefix)])) | ||||
elif external_part.endswith('"'): | elif external_part.endswith('"'): | ||||
continue | continue | ||||
elif not external_part.startswith("\\") and external_part != "-r": | elif not external_part.startswith("\\") and external_part != "-r": | ||||
# path of the external relative to dir_path | # path of the external relative to dir_path | ||||
path = external_part.replace("\\\\", "\\") | path = external_part.replace("\\\\", "\\") | ||||
if path == external_part: | if path == external_part: | ||||
path = external_part.replace("\\", "") | path = external_part.replace("\\", "") | ||||
path = path.lstrip("./") | if path.startswith("./"): | ||||
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) | revision = int(revision_s) | ||||
external_url = url | external_url = url | ||||
Show All 30 Lines |