allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jetm...@apache.org
Subject [38/45] allura git commit: [#7837] ticket:738 Implement paged_diffs for SVN
Date Mon, 30 Mar 2015 12:26:54 GMT
[#7837] ticket:738 Implement paged_diffs for SVN


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

Branch: refs/heads/ib/7837
Commit: 346db71cac5f21aeb59b6d9d396592364f05f8d8
Parents: 8b99fdc
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Tue Mar 3 13:46:16 2015 +0000
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Fri Mar 27 15:13:07 2015 +0000

----------------------------------------------------------------------
 ForgeSVN/forgesvn/model/svn.py | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/346db71c/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index 142ca6a..c033f44 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -780,5 +780,29 @@ class SVNImplementation(M.RepositoryImplementation):
     def tags(self):
         return []
 
+    def paged_diffs(self, commit_id, start=0, end=None):
+        added, removed, changed, total = [], [], [], 0
+        rev = self._revision(commit_id)
+        prev_rev = self._revision(self._oid(rev.number - 1))
+        summary = self._svn.diff_summarize(
+            self._url,
+            prev_rev,
+            self._url,
+            rev)
+        total = len(summary)
+        for s in summary:
+            if s.summarize_kind == pysvn.diff_summarize_kind.added:
+                added.append(h.really_unicode(s.path))
+            elif s.summarize_kind == pysvn.diff_summarize_kind.delete:
+                removed.append(h.really_unicode(s.path))
+            elif s.summarize_kind == pysvn.diff_summarize_kind.modified:
+                changed.append(h.really_unicode(s.path))
+        return {
+            'added': added,
+            'removed': removed,
+            'changed': changed,
+            'total': total,
+        }
+
 
 Mapper.compile_all()


Mime
View raw message