SVN URL Parser - libvcs.url.svn¶
For svn, aka svn(1).
Detect, parse, and validate SVN (Subversion) URLs.
Detect:
SvnURL.is_valid()Parse:
SvnURLcompare to
urllib.parse.ParseResultOutput
svn(1)URL:SvnURL.to_url()
Note
Subversion isn’t seen as often these days, can you “rage against the dying of the light” and assure its light is not extinguished? Help assure SVN URL parsing is correct and robust. Visit the project tracker and give us a wave. This API won’t be stabilized until we’re confident Subversion is covered accurately and can handle all-terrain scenarios.
-
libvcs.url.svn.DEFAULT_RULES: list[Rule] = [Rule(label=core-svn, description=Vanilla svn pattern, pattern=re.compile('\n ^\n (?P<scheme>\n (\n file|http|https|svn|svn\\+ssh\n )\n )\n\n ://\n \n ((?P<user>[^/:@]+)@)?\n\n \n (?P<hostname>([^/:@]+))\n (:(?P<po, re.VERBOSE), defaults={}), Rule(label=core-svn-scp, description=Vanilla scp(1) / ssh(1) type URL, pattern=re.compile("\n ^(?P<scheme>ssh)?\n \n ((?P<user>[^/:@]+)@)?\n\n \n # Server, e.g. 'github.com'.\n (?P<hostname>([^/:]+))\n (?P<separator>:)\n # The server-side path. e.g. 'use, re.VERBOSE), defaults={'username': 'svn'})]¶
Core regular expressions. These are patterns understood by
svn(1)
-
libvcs.url.svn.PIP_DEFAULT_RULES: list[Rule] = [Rule(label=pip-url, description=pip-style svn URL, pattern=re.compile('\n ^\n (?P<scheme>\n (\n svn\\+ssh|\n svn\\+https|\n svn\\+http\n )\n )\n\n ://\n \n ((?P<user>[^/:@]+)@)?\n\n \n (?P<hostname>(, re.VERBOSE), defaults={}, is_explicit=True), Rule(label=pip-file-url, description=pip-style svn+file:// URL, pattern=re.compile('\n (?P<scheme>svn\\+file)://\n (?P<path>.*)\n ', re.VERBOSE), defaults={}, is_explicit=True)]¶
pip-style svn URLs.
Examples of PIP-style svn URLs (via pip.pypa.io):
MyProject @ svn+https://svn.example.com/MyProject MyProject @ svn+ssh://svn.example.com/MyProject MyProject @ svn+ssh://user@svn.example.com/MyProject
Refs (via pip.pypa.io):
MyProject @ -e svn+http://svn.example.com/svn/MyProject/trunk@2019 MyProject @ -e svn+http://svn.example.com/svn/MyProject/trunk@{20080101}
Notes
-
class libvcs.url.svn.SvnBaseURL¶
Bases:
URLProtocol,SkipDefaultFieldsReprMixinSVN repository location. Parses URLs on initialization.
Examples
>>> SvnBaseURL( ... url='svn+ssh://svn.debian.org/svn/aliothproj/path/in/project/repository') SvnBaseURL(url=svn+ssh://svn.debian.org/svn/aliothproj/path/in/project/repository, scheme=svn+ssh, hostname=svn.debian.org, path=svn/aliothproj/path/in/project/repository, rule=core-svn)
>>> myrepo = SvnBaseURL( ... url='svn+ssh://svn.debian.org/svn/aliothproj/path/in/project/repository' ... )
>>> myrepo.hostname 'svn.debian.org'
>>> myrepo.path 'svn/aliothproj/path/in/project/repository'
Compatibility checking:
SvnBaseURL.is_valid()URLs compatible with
svn(1):SvnBaseURL.to_url()
-
class libvcs.url.svn.SvnPipURL¶
Bases:
SvnBaseURL,URLProtocol,SkipDefaultFieldsReprMixinSupports pip svn URLs.
-
class libvcs.url.svn.SvnURL¶
Bases:
SvnPipURL,SvnBaseURL,URLProtocol,SkipDefaultFieldsReprMixinBatteries included URL Parser. Supports svn(1) and pip URLs.
Ancestors (MRO) This URL parser inherits methods and attributes from the following parsers: