Return-Path: X-Original-To: apmail-allura-commits-archive@www.apache.org Delivered-To: apmail-allura-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 96B551776C for ; Wed, 1 Apr 2015 21:10:19 +0000 (UTC) Received: (qmail 82974 invoked by uid 500); 1 Apr 2015 21:10:19 -0000 Delivered-To: apmail-allura-commits-archive@allura.apache.org Received: (qmail 82929 invoked by uid 500); 1 Apr 2015 21:10:19 -0000 Mailing-List: contact commits-help@allura.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@allura.apache.org Delivered-To: mailing list commits@allura.apache.org Received: (qmail 81856 invoked by uid 99); 1 Apr 2015 21:10:18 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2015 21:10:18 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id CFB87E2F1D; Wed, 1 Apr 2015 21:10:18 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: heiths@apache.org To: commits@allura.apache.org Date: Wed, 01 Apr 2015 21:10:59 -0000 Message-Id: <9b3584738a1444519be0f5791fbb6fd6@git.apache.org> In-Reply-To: <9525b89c1fa746dc81740d5197f0030c@git.apache.org> References: <9525b89c1fa746dc81740d5197f0030c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [42/45] allura git commit: [#7837] ticket:750 Handle copied in svn [#7837] ticket:750 Handle copied in svn Project: http://git-wip-us.apache.org/repos/asf/allura/repo Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/5fc04589 Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/5fc04589 Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/5fc04589 Branch: refs/heads/hss/7072 Commit: 5fc0458959a2041351292c65b2e3649bbe10efb0 Parents: 6d9c49d Author: Igor Bondarenko Authored: Fri Mar 27 16:19:19 2015 +0000 Committer: Dave Brondsema Committed: Mon Mar 30 19:20:42 2015 +0000 ---------------------------------------------------------------------- Allura/allura/model/repository.py | 5 ++++- Allura/allura/templates/repo/commit.html | 2 +- ForgeSVN/forgesvn/model/svn.py | 17 +++++++++++++++-- 3 files changed, 20 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/allura/blob/5fc04589/Allura/allura/model/repository.py ---------------------------------------------------------------------- diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py index fb9a04e..edebeb4 100644 --- a/Allura/allura/model/repository.py +++ b/Allura/allura/model/repository.py @@ -1107,7 +1107,10 @@ class Commit(RepoObject, ActivityObject): def paged_diffs(self, start=0, end=None): diffs = self.repo.paged_diffs(self._id, start, end) - diffs['copied'] = self._diffs_copied(diffs['added'], diffs['removed']) + if not diffs.get('copied'): + diffs['copied'] = [] + copied = self._diffs_copied(diffs['added'], diffs['removed']) + diffs['copied'].extend(copied) return Object( added=diffs['added'], removed=diffs['removed'], http://git-wip-us.apache.org/repos/asf/allura/blob/5fc04589/Allura/allura/templates/repo/commit.html ---------------------------------------------------------------------- diff --git a/Allura/allura/templates/repo/commit.html b/Allura/allura/templates/repo/commit.html index 9c6342f..98afbba 100644 --- a/Allura/allura/templates/repo/commit.html +++ b/Allura/allura/templates/repo/commit.html @@ -148,7 +148,7 @@ Commit {{commit.shorthand_id()}} {{commit_labels( File was removed. {% elif type == 'copied' %} {% if file.ratio == 1 %} - File was renamed. + File was copied or renamed. {% else %} {{g.highlight(file.diff, lexer='diff')}} {% endif %} http://git-wip-us.apache.org/repos/asf/allura/blob/5fc04589/ForgeSVN/forgesvn/model/svn.py ---------------------------------------------------------------------- diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py index f37c1e2..cf70b7d 100644 --- a/ForgeSVN/forgesvn/model/svn.py +++ b/ForgeSVN/forgesvn/model/svn.py @@ -781,7 +781,13 @@ class SVNImplementation(M.RepositoryImplementation): return [] def paged_diffs(self, commit_id, start=0, end=None): - result = {'added': [], 'removed': [], 'changed': [], 'total': 0} + result = { + 'added': [], + 'removed': [], + 'changed': [], + 'copied': [], + 'total': 0, + } rev = self._revision(commit_id) try: log_info = self._svn.log( @@ -798,7 +804,14 @@ class SVNImplementation(M.RepositoryImplementation): paths = log_info[0].changed_paths result['total'] = len(paths) for p in paths[start:end]: - if p['action'] == 'A': + if p['copyfrom_path'] is not None: + result['copied'].append({ + 'new': h.really_unicode(p.path), + 'old': h.really_unicode(p.copyfrom_path), + 'ratio': 1, + 'diff': '', + }) + elif p['action'] == 'A': result['added'].append(h.really_unicode(p.path)) elif p['action'] == 'D': result['removed'].append(h.really_unicode(p.path))