You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by he...@apache.org on 2015/04/01 23:10:54 UTC
[37/45] allura git commit: [#7837] ticket:738 Implement paged_diffs
for SVN
[#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/0b5bc0a4
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/0b5bc0a4
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/0b5bc0a4
Branch: refs/heads/hss/7072
Commit: 0b5bc0a4dac53496dc38a6e83ec2a621a0ec82f8
Parents: 0a5c8fd
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Mar 3 13:46:16 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Mar 30 19:20:41 2015 +0000
----------------------------------------------------------------------
ForgeSVN/forgesvn/model/svn.py | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/0b5bc0a4/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()