This is an automated email from the ASF dual-hosted git repository.
brondsem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git
The following commit(s) were added to refs/heads/master by this push:
new f0a23b4e5 Lower SVN import retry count significantly; block imports
from plugins.svn.wordpress.org since it has millions of revisions
f0a23b4e5 is described below
commit f0a23b4e5138e7cf960556b7da4dbfa02b75f71d
Author: Dave Brondsema <[email protected]>
AuthorDate: Mon Jul 11 13:10:46 2022 -0400
Lower SVN import retry count significantly; block imports from
plugins.svn.wordpress.org since it has millions of revisions
---
Allura/development.ini | 2 +-
ForgeSVN/forgesvn/model/svn.py | 2 +-
ForgeSVN/forgesvn/widgets.py | 7 +++++++
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/Allura/development.ini b/Allura/development.ini
index f53b9aa75..af474b5f6 100644
--- a/Allura/development.ini
+++ b/Allura/development.ini
@@ -398,7 +398,7 @@ scm.repos.tarball.zip_binary = /usr/bin/zip
; SCM imports (currently just SVN) will retry if it fails
; You can control the number of tries and delay between tries here:
-scm.import.retry_count = 50
+scm.import.retry_count = 3
scm.import.retry_sleep_secs = 5
; When getting a list of valid references (branches/tags) from a repo, you can
cache
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index c10edf751..6501374c5 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -271,7 +271,7 @@ class SVNImplementation(M.RepositoryImplementation):
clear_hook('pre-revprop-change')
else:
def retry_cmd(cmd, fail_count=0):
- max_fail = asint(tg.config.get('scm.import.retry_count', 50))
+ max_fail = asint(tg.config.get('scm.import.retry_count', 3))
returncode = -1
while returncode != 0 and fail_count < max_fail:
stdout, stderr, returncode = self.check_call(cmd,
fail_on_error=False)
diff --git a/ForgeSVN/forgesvn/widgets.py b/ForgeSVN/forgesvn/widgets.py
index 060560c94..8f4ad6539 100644
--- a/ForgeSVN/forgesvn/widgets.py
+++ b/ForgeSVN/forgesvn/widgets.py
@@ -19,6 +19,7 @@ import re
import ew as ew_core
import ew.jinja2_ew as ew
+from formencode import validators as fev
from allura.lib import validators
from allura.lib.widgets.forms import ForgeForm
@@ -39,6 +40,12 @@ class ValidateSvnUrl(validators.URLIsPrivate):
$
''', re.I | re.VERBOSE)
+ def _to_python(self, value, state):
+ value = super()._to_python(value, state)
+ if 'plugins.svn.wordpress.org' in value:
+ raise fev.Invalid("That SVN repo is to large to import from.",
value, state)
+ return value
+
class ImportForm(ForgeForm):
submit_text = 'Import'