allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [04/17] allura git commit: [#7837] ticket:736 Rewrite Commit.added_paths
Date Mon, 30 Mar 2015 19:30:29 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/d50d3509
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/d50d3509
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/d50d3509

Branch: refs/heads/master
Commit: d50d3509ca2faed9bd6abf16566f296d5a3e7e8f
Parents: 78ee673
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Mon Mar 2 15:01:25 2015 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Mon Mar 30 19:20:40 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/d50d3509/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