allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [19/46] git commit: [#5973] remove pysvn dependency from Allura package
Date Wed, 03 Apr 2013 17:26:48 GMT
[#5973] remove pysvn dependency from Allura package


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

Branch: refs/heads/cj/5879
Commit: 6db2bc233a5aa4b33b0b4e131c2754b6df7903fe
Parents: 92607ab
Author: Dave Brondsema <dbrondsema@geek.net>
Authored: Thu Mar 14 13:04:42 2013 -0400
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Tue Apr 2 21:29:20 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/utils.py                       |   10 ----------
 ForgeSVN/forgesvn/model/svn.py                   |   10 +++++++++-
 ForgeSVN/forgesvn/svn_main.py                    |    2 +-
 ForgeSVN/forgesvn/tests/model/test_repository.py |    2 +-
 4 files changed, 11 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6db2bc23/Allura/allura/lib/utils.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/utils.py b/Allura/allura/lib/utils.py
index fa63b38..6e2d3b8 100644
--- a/Allura/allura/lib/utils.py
+++ b/Allura/allura/lib/utils.py
@@ -27,7 +27,6 @@ from pygments.formatters import HtmlFormatter
 
 from ew import jinja2_ew as ew
 from ming.utils import LazyProperty
-import pysvn
 
 def permanent_redirect(url):
     try:
@@ -418,15 +417,6 @@ def generate_code_stats(blob):
     return stats
 
 
-def svn_path_exists(path):
-    svn = pysvn.Client()
-    try:
-        svn.info2(path)
-        return True
-    except pysvn.ClientError, e:
-        return False
-
-
 def is_text_file(file):
     msg = magic.from_buffer(file[:1024])
     if ("text" in msg) or ("empty" in msg):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6db2bc23/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index 171c709..4d09534 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -26,7 +26,6 @@ from ming.utils import LazyProperty
 from allura import model as M
 from allura.lib import helpers as h
 from allura.model.auth import User
-from allura.lib.utils import svn_path_exists
 
 log = logging.getLogger(__name__)
 
@@ -98,6 +97,15 @@ class SVNCalledProcessError(Exception):
             (self.cmd, self.returncode, self.stdout, self.stderr)
 
 
+def svn_path_exists(path):
+    svn = SVNLibWrapper(pysvn.Client())
+    try:
+        svn.info2(path)
+        return True
+    except pysvn.ClientError:
+        return False
+
+
 class SVNLibWrapper(object):
     """Wrapper around pysvn, used for instrumentation."""
     def __init__(self, client):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6db2bc23/ForgeSVN/forgesvn/svn_main.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/svn_main.py b/ForgeSVN/forgesvn/svn_main.py
index 29e531a..2df8ea4 100644
--- a/ForgeSVN/forgesvn/svn_main.py
+++ b/ForgeSVN/forgesvn/svn_main.py
@@ -18,13 +18,13 @@ from allura.lib.repository import RepositoryApp, RepoAdminController
 from allura.app import SitemapEntry, ConfigOption
 from allura.lib import helpers as h
 from allura import model as M
-from allura.lib.utils import svn_path_exists
 
 # Local imports
 from . import model as SM
 from . import version
 from . import widgets
 from .controllers import BranchBrowser
+from .model.svn import svn_path_exists
 
 log = logging.getLogger(__name__)
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6db2bc23/ForgeSVN/forgesvn/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/model/test_repository.py b/ForgeSVN/forgesvn/tests/model/test_repository.py
index 43d6cbc..89964a7 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -17,11 +17,11 @@ from ming.orm import session, ThreadLocalORMSession
 from alluratest.controller import setup_basic_test, setup_global_objects
 from allura import model as M
 from allura.lib import helpers as h
-from allura.lib.utils import svn_path_exists
 from allura.tests import decorators as td
 from allura.tests.model.test_repo import RepoImplTestBase
 
 from forgesvn import model as SM
+from forgesvn.model.svn import svn_path_exists
 from forgesvn.tests import with_svn
 
 class TestNewRepo(unittest.TestCase):


Mime
View raw message