allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jetm...@apache.org
Subject [33/45] allura git commit: [#7837] ticket:736 Rewrite Commit.added_paths
Date Mon, 30 Mar 2015 12:26:49 GMT
[#7837] ticket:736 Rewrite Commit.added_paths


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

Branch: refs/heads/ib/7837
Commit: 12963fc4514d1a24117ab4db9f474dcfa66c9e14
Parents: d14a546
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Mon Mar 2 15:01:25 2015 +0000
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Fri Mar 27 15:09:24 2015 +0000

----------------------------------------------------------------------
 Allura/allura/model/repository.py | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/12963fc4/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index 9255c66..d15394f 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -1235,7 +1235,7 @@ class Commit(RepoObject, ActivityObject):
         Leading and trailing slashes are removed, and
         the list is complete, meaning that if a directory
         with subdirectories is added, all of the child
-        paths are included (this relies on the DiffInfoDoc
+        paths are included (this relies on the :meth paged_diffs:
         being complete).
 
         Example:
@@ -1245,13 +1245,10 @@ class Commit(RepoObject, ActivityObject):
             the file /foo/bar/baz/qux.txt, this would return:
             ['foo/bar', 'foo/bar/baz', 'foo/bar/baz/qux.txt']
         '''
-        diff_info = DiffInfoDoc.m.get(_id=self._id)
-        diffs = set()
-        if diff_info:
-            for d in diff_info.differences:
-                if d.lhs_id is None:
-                    diffs.add(d.name.strip('/'))
-        return diffs
+        paths = set()
+        for path in self.paged_diffs(self._id)['added']:
+            paths.add(path.strip('/'))
+        return paths
 
     @LazyProperty
     def info(self):


Mime
View raw message