]> git.e2factory.org Git - e2factory.git/commitdiff
Add http, https and svn url support to svn plugin
authorTobias Ulmer <tu@emlix.com>
Wed, 6 Mar 2013 18:20:04 +0000 (19:20 +0100)
committerTobias Ulmer <tu@emlix.com>
Thu, 7 Mar 2013 16:24:01 +0000 (17:24 +0100)
Suggested by a patch from CADCON

Signed-off-by: Tobias Ulmer <tu@emlix.com>
local/svn.lua

index 1caf537dc32d73517a70b43a395315c79d1d84ec..185c7cbbc310cd9136cd8a8ff297539ccf216071 100644 (file)
@@ -51,21 +51,24 @@ local function mksvnurl(surl)
     local rc, re
     local e = err.new("cannot translate url into subversion url:")
     e:append("%s", surl)
+
     local u, re = url.parse(surl)
     if not u then
         return nil, e:cat(re)
     end
+
     local transport
-    -- TODO: http, https and svn are valid transports that should be added
     if u.transport == "ssh" or u.transport == "scp" or
         u.transport == "rsync+ssh" then
         transport = "svn+ssh"
-    elseif u.transport == "file" then
-        transport = "file"
+    elseif u.transport == "http" or u.transport == "https"
+        or u.transport == "svn" or u.transport == "file" then
+        transport = u.transport
     else
-        return nil, e:append(string.format("unsupported subversion transport: %s",
-        u.transport))
+        return nil,
+            e:append("unsupported subversion transport: %s", u.transport)
     end
+
     return string.format("%s://%s/%s", transport, u.server, u.path)
 end