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 1448B10A93 for ; Thu, 5 Mar 2015 10:35:29 +0000 (UTC) Received: (qmail 51439 invoked by uid 500); 5 Mar 2015 10:35:29 -0000 Delivered-To: apmail-allura-commits-archive@allura.apache.org Received: (qmail 51392 invoked by uid 500); 5 Mar 2015 10:35:29 -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 51217 invoked by uid 99); 5 Mar 2015 10:35:28 -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; Thu, 05 Mar 2015 10:35:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7FC5CE1072; Thu, 5 Mar 2015 10:35:28 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jetmind@apache.org To: commits@allura.apache.org Date: Thu, 05 Mar 2015 10:35:34 -0000 Message-Id: <7535ac3145c34270bbd810e141b1de8c@git.apache.org> In-Reply-To: <5ababb55e9d04b99b8398d84d2b9bbd5@git.apache.org> References: <5ababb55e9d04b99b8398d84d2b9bbd5@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [07/13] allura git commit: [#7837] ticket:736 Fix filenames with whitespaces and/or unicode [#7837] ticket:736 Fix filenames with whitespaces and/or unicode Project: http://git-wip-us.apache.org/repos/asf/allura/repo Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/5115e753 Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/5115e753 Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/5115e753 Branch: refs/heads/ib/7837 Commit: 5115e7533e0850a5509dff1ecaa3f9dc0dc15121 Parents: 7cb590b Author: Igor Bondarenko Authored: Tue Mar 3 10:06:55 2015 +0000 Committer: Igor Bondarenko Committed: Wed Mar 4 16:58:38 2015 +0000 ---------------------------------------------------------------------- ForgeGit/forgegit/model/git_repo.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/allura/blob/5115e753/ForgeGit/forgegit/model/git_repo.py ---------------------------------------------------------------------- diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py index 4d8ffc1..7f5847a 100644 --- a/ForgeGit/forgegit/model/git_repo.py +++ b/ForgeGit/forgegit/model/git_repo.py @@ -570,11 +570,14 @@ class GitImplementation(M.RepositoryImplementation): # show tree entry itself as well as subtrees (Commit.added_paths # relies on this) '-t', + '-z', # don't escape filenames and use \x00 as fields delimiter commit_id) - files = files.splitlines() - total = len(files) - for f in files[start:end]: - status, name = f.split('\t', 1) + files = files.split('\x00')[:-1] + # files = ['A', 'filename', 'D', 'another filename', ...] + total = len(files) / 2 + for i in range(1, len(files), 2): + status = files[i-1] + name = h.really_unicode(files[i]) if status == 'A': added.append(name) elif status == 'D':