allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject git commit: [#6068] fix paged_diffs return value when no DiffInfoDoc found
Date Mon, 08 Apr 2013 17:22:21 GMT
Updated Branches:
  refs/heads/db/6068 5bc575250 -> 2dfbcfb25 (forced update)


[#6068] fix paged_diffs return value when no DiffInfoDoc found


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

Branch: refs/heads/db/6068
Commit: 2dfbcfb25a24f844c332f7e3643fe0df5dc60eb0
Parents: b08571f
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Mon Apr 8 13:17:26 2013 -0400
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Mon Apr 8 17:22:11 2013 +0000

----------------------------------------------------------------------
 Allura/allura/model/repo.py                      |    2 +-
 ForgeSVN/forgesvn/tests/model/test_repository.py |    6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2dfbcfb2/Allura/allura/model/repo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo.py b/Allura/allura/model/repo.py
index 4d396b8..d8b06be 100644
--- a/Allura/allura/model/repo.py
+++ b/Allura/allura/model/repo.py
@@ -270,7 +270,7 @@ class Commit(RepoObject):
     def paged_diffs(self, start=0, end=None):
         di = DiffInfoDoc.m.get(_id=self._id)
         if di is None:
-            return Object(added=[], removed=[], changed=[], copied=[])
+            return Object(added=[], removed=[], changed=[], copied=[], total=0)
         added = []
         removed = []
         changed = []

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2dfbcfb2/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 676a887..09745e7 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -209,7 +209,11 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
         expected =  dict(
                 copied=[], changed=[], removed=[],
                 added=['/a/b', '/a/b/c'], total=4)
-        self.assertEqual(expected, entry.paged_diffs(start=1, end=3))
+        actual = entry.paged_diffs(start=1, end=3)
+        self.assertEqual(expected, actual)
+
+        empty = M.repo.Commit().paged_diffs()
+        self.assertEqual(sorted(actual.keys()), sorted(empty.keys()))
 
     def test_diff_create_file(self):
         entry = self.repo.log(1, limit=1)[0]


Mime
View raw message