aboutsummaryrefslogtreecommitdiffstats
path: root/MgaRepo/svn.py
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <proyvind@moondrake.org>2016-08-18 17:54:49 +0200
committerPer Øyvind Karlsen <proyvind@moondrake.org>2016-08-18 17:54:49 +0200
commit14d5c0398fa649f03b6e0f43ab811594890a9a91 (patch)
tree5832bda72bf1f163f6c31ffb93cdfa431b292adf /MgaRepo/svn.py
parentcd6cad27819e2e1a16a1a17a9b3cb80dd921ed3f (diff)
downloadmgarepo-14d5c0398fa649f03b6e0f43ab811594890a9a91.tar
mgarepo-14d5c0398fa649f03b6e0f43ab811594890a9a91.tar.gz
mgarepo-14d5c0398fa649f03b6e0f43ab811594890a9a91.tar.bz2
mgarepo-14d5c0398fa649f03b6e0f43ab811594890a9a91.tar.xz
mgarepo-14d5c0398fa649f03b6e0f43ab811594890a9a91.zip
auomatically fallback to non-ssh when authentication fails
Diffstat (limited to 'MgaRepo/svn.py')
-rw-r--r--MgaRepo/svn.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/MgaRepo/svn.py b/MgaRepo/svn.py
index 5f8851c..cc1ed1b 100644
--- a/MgaRepo/svn.py
+++ b/MgaRepo/svn.py
@@ -19,6 +19,17 @@ class SVN(VCS):
self.vcs_command = config.get("global", "svn-command", ["svn"])
self.env_defaults = {"SVN_SSH": self.vcs_wrapper}
+ def drop_ssh_if_no_auth(self, url):
+ if url and url.startswith("svn+ssh://"):
+ cmd = ["info", "--non-interactive", "--no-newline", "--show-item", "url", url]
+ status, output = self._execVcs(*cmd, local=True, noerror=True, show=False)
+ if status == 1 and (("E170013" in output) or ("E210002" in output)):
+ url = url.replace("svn+ssh://", "svn://")
+ status, output = self._execVcs(*cmd, local=True, noerror=True, show=False)
+ if status == 0 and output == url:
+ pass
+ return url
+
class SVNLook(VCSLook):
def __init__(self, repospath, txn=None, rev=None):
VCSLook.__init__(self, repospath, txn, rev)