allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [22/40] git commit: [#6603] Don't recurse when checking SVN path existance (not needed)
Date Thu, 31 Oct 2013 21:57:33 GMT
[#6603] Don't recurse when checking SVN path existance (not needed)

Signed-off-by: Cory Johns <cjohns@slashdotmedia.com>


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

Branch: refs/heads/cj/6714
Commit: 63525515d82c0c9dfd320432566bee4470fe6108
Parents: 152838e
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Fri Oct 25 20:33:38 2013 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Fri Oct 25 20:33:38 2013 +0000

----------------------------------------------------------------------
 ForgeSVN/forgesvn/model/svn.py                   | 2 +-
 ForgeSVN/forgesvn/tests/model/test_repository.py | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/63525515/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index 24e8bdd..4c63df6 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -106,7 +106,7 @@ def svn_path_exists(path, rev=None):
     else:
         rev = pysvn.Revision(pysvn.opt_revision_kind.head)
     try:
-        svn.info2(path, revision=rev)
+        svn.info2(path, revision=rev, recurse=False)
         return True
     except pysvn.ClientError:
         return False

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/63525515/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 e7864e5..fd400ca 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -387,6 +387,12 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
         assert svn_path_exists("file://%s/a" % repo_path)
         assert svn_path_exists("file://%s" % repo_path)
         assert not svn_path_exists("file://%s/badpath" % repo_path)
+        with mock.patch('forgesvn.model.svn.pysvn') as pysvn:
+            svn_path_exists('dummy')
+            pysvn.Client.return_value.info2.assert_called_once_with(
+                    'dummy',
+                    revision=pysvn.Revision.return_value,
+                    recurse=False)
 
     @onlyif(os.path.exists(tg.config.get('scm.repos.tarball.zip_binary', '/usr/bin/zip')),
'zip binary is missing')
     def test_tarball(self):


Mime
View raw message