Skip to content

Commit d9d2cc4

Browse files
committed
refactor(cmd[svn]): Remove get_rev_options() (unused)
1 parent bff3a02 commit d9d2cc4

1 file changed

Lines changed: 0 additions & 31 deletions

File tree

src/libvcs/sync/svn.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@
1111
1212
- [`SvnSync.get_url`](libvcs.svn.SvnSync.get_url)
1313
- [`SvnSync.get_revision`](libvcs.svn.SvnSync.get_revision)
14-
- [`get_rev_options`](libvcs.svn.get_rev_options)
1514
""" # NOQA: E5
1615
import logging
1716
import os
1817
import pathlib
1918
import re
2019
from typing import Any, Optional
21-
from urllib import parse as urlparse
2220

2321
from libvcs._internal.run import run
2422
from libvcs._internal.types import StrPath
@@ -203,32 +201,3 @@ def _get_svn_url_rev(cls, location: str) -> tuple[Optional[str], int]:
203201
@property
204202
def cmd(self, *args: object, **kwargs: object) -> Svn:
205203
return Svn(dir=self.dir, *args, **kwargs)
206-
207-
208-
def get_rev_options(url: str, rev: None) -> list[Any]:
209-
"""Return revision options. From pip pip.vcs.subversion."""
210-
if rev:
211-
rev_options = ["-r", rev]
212-
else:
213-
rev_options = []
214-
215-
r = urlparse.urlsplit(url)
216-
if hasattr(r, "username"):
217-
# >= Python-2.5
218-
username, password = r.username, r.password
219-
else:
220-
netloc = r[1]
221-
if "@" in netloc:
222-
auth = netloc.split("@")[0]
223-
if ":" in auth:
224-
username, password = auth.split(":", 1)
225-
else:
226-
username, password = auth, None
227-
else:
228-
username, password = None, None
229-
230-
if username:
231-
rev_options += ["--username", username]
232-
if password:
233-
rev_options += ["--password", password]
234-
return rev_options

0 commit comments

Comments
 (0)