gbp-clone: Support salsa: pseudo urls
authorGuido Günther <agx@sigxcpu.org>
Tue, 13 Aug 2019 17:57:49 +0000 (19:57 +0200)
committerGuido Günther <agx@sigxcpu.org>
Tue, 13 Aug 2019 17:57:49 +0000 (19:57 +0200)
docs/manpages/gbp-clone.xml
gbp/scripts/clone.py

index 11a93434fc19395acdba2e3974222c4e4f2199a6..2f08d66a783c1b81fb8dbe64a266533ef3c1d10c 100644 (file)
       Clone from the <emphasis>Git-Vcs</emphasis> URL of a package:
     </para>
     <screen>
-      &gbp-clone; vcsgit:libvirt</screen>
+    &gbp-clone; vcsgit:libvirt</screen>
     <para>
+      Clone a repository from salsa (Debian's code hosting):
+    </para>
+    <screen>
+      &gbp-clone; salsa:agx/git-buildpackage</screen>
+        <para>
       Clone from a github repository:
     </para>
     <screen>
index edc991edf46be0752090153f0881da4d102de841..b17241b6c76a4e4f74250b46e3ed03be123ec0ee 100755 (executable)
@@ -81,6 +81,8 @@ def repo_to_url(repo):
     """
     >>> repo_to_url("https://foo.example.com")
     'https://foo.example.com'
+    >>> repo_to_url("salsa:agx/git-buildpackage")
+    'https://salsa.debian.org/agx/git-buildpackage.git'
     >>> repo_to_url("github:agx/git-buildpackage")
     'https://github.com/agx/git-buildpackage.git'
     """
@@ -90,6 +92,8 @@ def repo_to_url(repo):
     else:
         proto, path = parts
 
+    if proto == 'salsa':
+        return 'https://salsa.debian.org/%s.git' % path
     if proto == 'github':
         return 'https://github.com/%s.git' % path
     elif proto in ['vcsgit', 'vcs-git']: