allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject allura git commit: Some SVN errors have critical info after the "Unable to connect" lines (e.g. unreadable repo formats from a newer SVN versions), and should not be treated like an empty/missing dir
Date Mon, 17 Apr 2017 19:26:09 GMT
Repository: allura
Updated Branches:
  refs/heads/master f8ce641fe -> 6a84b2c03


Some SVN errors have critical info after the "Unable to connect" lines (e.g. unreadable repo
formats from a newer SVN versions), and should not be treated like an empty/missing dir


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/6a84b2c0
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/6a84b2c0
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/6a84b2c0

Branch: refs/heads/master
Commit: 6a84b2c03f511bd31f4ac6dcee2bdc6e00fa7baf
Parents: f8ce641
Author: Dave Brondsema <dave@brondsema.net>
Authored: Mon Apr 17 11:37:12 2017 -0400
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Mon Apr 17 11:37:12 2017 -0400

----------------------------------------------------------------------
 ForgeSVN/forgesvn/model/svn.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/6a84b2c0/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index 28545bb..db52738 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -748,8 +748,9 @@ class SVNImplementation(M.RepositoryImplementation):
         try:
             return int(self._svn.revpropget('revision', url=self._url)[0].number)
         except pysvn.ClientError as e:
-            if str(e).startswith("Unable to connect") or \
-                    str(e).startswith("Unable to open"):
+            error_lines = str(e).splitlines()
+            if all(errline.startswith(("Unable to connect", "Unable to open")) for errline
in error_lines):
+                # simple common error e.g. empty repo directory
                 return 0
             else:
                 raise


Mime
View raw message