allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jetm...@apache.org
Subject git commit: [#7581] don't try to get commit sizes for log views of non-files
Date Wed, 23 Jul 2014 09:45:03 GMT
Repository: allura
Updated Branches:
  refs/heads/master 9828de981 -> 0e18d9fc4


[#7581] don't try to get commit sizes for log views of non-files

We don't show 'size' values for directory commit logs anyway, and svn
1.8 started returning -1 instead of 0 causing a test to fail.


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

Branch: refs/heads/master
Commit: 0e18d9fc45c75e5d3b0c9a3d9db637539152230d
Parents: 9828de9
Author: Dave Brondsema <dave@brondsema.net>
Authored: Tue Jul 22 16:21:10 2014 -0400
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Tue Jul 22 16:21:10 2014 -0400

----------------------------------------------------------------------
 ForgeSVN/forgesvn/model/svn.py                   | 12 +++++++-----
 ForgeSVN/forgesvn/tests/model/test_repository.py | 12 ++++++------
 2 files changed, 13 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/0e18d9fc/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index af05713..92dc292 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -585,11 +585,13 @@ class SVNImplementation(M.RepositoryImplementation):
     def _map_log(self, ci, url, path=None):
         revno = ci.revision.number
         rev = pysvn.Revision(pysvn.opt_revision_kind.number, revno)
-        try:
-            size = int(
-                self._svn.list(url, revision=rev, peg_revision=rev)[0][0].size)
-        except pysvn.ClientError:
-            size = None
+        size = None
+        if path:
+            try:
+                size = int(
+                    self._svn.list(url, revision=rev, peg_revision=rev)[0][0].size)
+            except pysvn.ClientError:
+                pass
         rename_details = {}
         changed_paths = ci.get('changed_paths', [])
         for changed_path in changed_paths:

http://git-wip-us.apache.org/repos/asf/allura/blob/0e18d9fc/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 a9d712d..70c34ac 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -247,7 +247,7 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
                  'date': datetime(2013, 11, 8, 13, 38, 11, 152821),
                  'name': u'coldmind',
                  'email': ''
-             }, 'size': 0},
+             }, 'size': None},
             {'parents': [4],
              'refs': [],
              'committed': {
@@ -261,7 +261,7 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
                  'date': datetime(2010, 11, 18, 20, 14, 21, 515743),
                  'name': u'rick446',
                  'email': ''},
-             'size': 0},
+             'size': None},
             {'parents': [3],
              'refs': [],
              'committed': {
@@ -275,7 +275,7 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
                  'date': datetime(2010, 10, 8, 15, 32, 59, 383719),
                  'name': u'rick446',
                  'email': ''},
-             'size': 0},
+             'size': None},
             {'parents': [2],
              'refs': [],
              'committed': {
@@ -289,7 +289,7 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
              {'date': datetime(2010, 10, 8, 15, 32, 48, 272296),
               'name': u'rick446',
               'email': ''},
-             'size': 0},
+             'size': None},
             {'parents': [1],
              'refs': [],
              'committed': {
@@ -303,7 +303,7 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
                  'date': datetime(2010, 10, 8, 15, 32, 36, 221863),
                  'name': u'rick446',
                  'email': ''},
-             'size': 0},
+             'size': None},
             {'parents': [],
              'refs': [],
              'committed': {
@@ -317,7 +317,7 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
                  'date': datetime(2010, 10, 8, 15, 32, 7, 238375),
                  'name': u'rick446',
                  'email': ''},
-             'size': 0}])
+             'size': None}])
 
     def test_log_file(self):
         entries = list(self.repo.log(path='/README', id_only=False))


Mime
View raw message