@@ -307,9 +307,9 @@ def to_url(self) -> str:
307
307
Examples
308
308
--------
309
309
310
- >>> git_location = GitURL(url='git@github.com:vcs-python/libvcs.git')
310
+ >>> git_url = GitURL(url='git@github.com:vcs-python/libvcs.git')
311
311
312
- >>> git_location
312
+ >>> git_url
313
313
GitURL(url=git@github.com:vcs-python/libvcs.git,
314
314
user=git,
315
315
hostname=github.com,
@@ -319,16 +319,16 @@ def to_url(self) -> str:
319
319
320
320
Switch repo libvcs -> vcspull:
321
321
322
- >>> git_location .path = 'vcs-python/vcspull'
322
+ >>> git_url .path = 'vcs-python/vcspull'
323
323
324
- >>> git_location .to_url()
324
+ >>> git_url .to_url()
325
325
'git@github.com:vcs-python/vcspull.git'
326
326
327
327
Switch them to gitlab:
328
328
329
- >>> git_location .hostname = 'gitlab.com'
329
+ >>> git_url .hostname = 'gitlab.com'
330
330
331
- >>> git_location .to_url()
331
+ >>> git_url .to_url()
332
332
'git@gitlab.com:vcs-python/vcspull.git'
333
333
334
334
todo
@@ -365,11 +365,11 @@ def to_url(self) -> str:
365
365
Examples
366
366
--------
367
367
368
- >>> git_location = GitPipURL(
368
+ >>> git_url = GitPipURL(
369
369
... url='git+ssh://git@bitbucket.example.com:7999/PROJ/repo.git'
370
370
... )
371
371
372
- >>> git_location
372
+ >>> git_url
373
373
GitPipURL(url=git+ssh://git@bitbucket.example.com:7999/PROJ/repo.git,
374
374
scheme=git+ssh,
375
375
user=git,
@@ -379,18 +379,18 @@ def to_url(self) -> str:
379
379
suffix=.git,
380
380
matcher=pip-url)
381
381
382
- >>> git_location .path = 'libvcs/vcspull'
382
+ >>> git_url .path = 'libvcs/vcspull'
383
383
384
- >>> git_location .to_url()
384
+ >>> git_url .to_url()
385
385
'git+ssh://bitbucket.example.com/libvcs/vcspull.git'
386
386
387
387
It also accepts revisions, e.g. branch, tag, ref:
388
388
389
- >>> git_location = GitPipURL(
389
+ >>> git_url = GitPipURL(
390
390
... url='git+https://github.com/vcs-python/libvcs.git@v0.10.0'
391
391
... )
392
392
393
- >>> git_location
393
+ >>> git_url
394
394
GitPipURL(url=git+https://github.com/vcs-python/libvcs.git@v0.10.0,
395
395
scheme=git+https,
396
396
hostname=github.com,
@@ -399,9 +399,9 @@ def to_url(self) -> str:
399
399
matcher=pip-url,
400
400
rev=v0.10.0)
401
401
402
- >>> git_location .path = 'libvcs/vcspull'
402
+ >>> git_url .path = 'libvcs/vcspull'
403
403
404
- >>> git_location .to_url()
404
+ >>> git_url .to_url()
405
405
'git+https://github.com/libvcs/vcspull.git@v0.10.0'
406
406
"""
407
407
url = super ().to_url ()
@@ -438,36 +438,36 @@ def to_url(self) -> str:
438
438
--------
439
439
440
440
SSH style URL:
441
- >>> git_location = GitURL(url='git@github.com:vcs-python/libvcs.git')
441
+ >>> git_url = GitURL(url='git@github.com:vcs-python/libvcs.git')
442
442
443
- >>> git_location .path = 'vcs-python/vcspull'
443
+ >>> git_url .path = 'vcs-python/vcspull'
444
444
445
- >>> git_location .to_url()
445
+ >>> git_url .to_url()
446
446
'git@github.com:vcs-python/vcspull.git'
447
447
448
448
HTTPs URL:
449
449
450
- >>> git_location = GitURL(url='https://github.com/vcs-python/libvcs.git')
450
+ >>> git_url = GitURL(url='https://github.com/vcs-python/libvcs.git')
451
451
452
- >>> git_location .path = 'vcs-python/vcspull'
452
+ >>> git_url .path = 'vcs-python/vcspull'
453
453
454
- >>> git_location .to_url()
454
+ >>> git_url .to_url()
455
455
'https://github.com/vcs-python/vcspull.git'
456
456
457
457
Switch them to gitlab:
458
458
459
- >>> git_location .hostname = 'gitlab.com'
459
+ >>> git_url .hostname = 'gitlab.com'
460
460
461
- >>> git_location .to_url()
461
+ >>> git_url .to_url()
462
462
'https://gitlab.com/vcs-python/vcspull.git'
463
463
464
464
Pip style URL, thanks to this class implementing :class:`GitPipURL`:
465
465
466
- >>> git_location = GitURL(url='git+ssh://git@github.com/vcs-python/libvcs')
466
+ >>> git_url = GitURL(url='git+ssh://git@github.com/vcs-python/libvcs')
467
467
468
- >>> git_location .hostname = 'gitlab.com'
468
+ >>> git_url .hostname = 'gitlab.com'
469
469
470
- >>> git_location .to_url()
470
+ >>> git_url .to_url()
471
471
'git+ssh://gitlab.com/vcs-python/libvcs'
472
472
473
473
See also
0 commit comments