From 3ece06120b1d0acf54636d4db3034b8e4417216b Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Wed, 6 Mar 2013 19:20:04 +0100 Subject: [PATCH] Add http, https and svn url support to svn plugin Suggested by a patch from CADCON Signed-off-by: Tobias Ulmer --- local/svn.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/local/svn.lua b/local/svn.lua index 1caf537..185c7cb 100644 --- a/local/svn.lua +++ b/local/svn.lua @@ -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 -- 2.39.5