From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Aguilar Subject: [PATCH v2 12/16] contrib/fast-import/import-zips.py: use spaces instead of tabs Date: Sat, 23 Feb 2013 16:50:20 -0800 Message-ID: <1361667024-49776-13-git-send-email-davvid@gmail.com> References: <1361667024-49776-1-git-send-email-davvid@gmail.com> <1361667024-49776-2-git-send-email-davvid@gmail.com> <1361667024-49776-3-git-send-email-davvid@gmail.com> <1361667024-49776-4-git-send-email-davvid@gmail.com> <1361667024-49776-5-git-send-email-davvid@gmail.com> <1361667024-49776-6-git-send-email-davvid@gmail.com> <1361667024-49776-7-git-send-email-davvid@gmail.com> <1361667024-49776-8-git-send-email-davvid@gmail.com> <1361667024-49776-9-git-send-email-davvid@gmail.com> <1361667024-49776-10-git-send-email-davvid@gmail.com> <1361667024-49776-11-git-send-email-davvid@gmail.com> <1361667024-49776-12-git-send-email-davvid@gmail.com> Cc: git@vger.kernel.org, Jonathan Nieder To: Junio C Hamano X-From: git-owner@vger.kernel.org Sun Feb 24 01:51:48 2013 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U9Pof-0000c0-Fr for gcvg-git-2@plane.gmane.org; Sun, 24 Feb 2013 01:51:46 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932149Ab3BXAvJ (ORCPT ); Sat, 23 Feb 2013 19:51:09 -0500 Received: from mail-pb0-f50.google.com ([209.85.160.50]:48968 "EHLO mail-pb0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932093Ab3BXAvF (ORCPT ); Sat, 23 Feb 2013 19:51:05 -0500 Received: by mail-pb0-f50.google.com with SMTP id up1so1056451pbc.9 for ; Sat, 23 Feb 2013 16:51:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=9wtvcL0Jfj39O3V9YoTBh/rTN796P8/nmMJA5OdMb+s=; b=ejOL0mouyEnvvV169RFpA6NaoBOzj4MJ8Ik4QYYm8zpvuJVVApdQ/c/YojmQYCgB/w iN9wVZddueO5DwB8nlxo1stak+pna0W21jma8Af9XrOm9aYdvKXc64lrx2UxZ3EP8ETX 0uEJc/FoaAaeZ2Urn7kPL7E3i570yvyS63slhIaIZyfJn/j8fNWJesMkzSVaj7OQoZKB +0a/MKCwY4IkyYK82LCYi60szskd5EFI3Q5KvHQufUFOMOwch0xZ/f9NRo+UIdy+oJMW 8ztdU1Ei5+GhcqOjYNvbJPtkc4fwtt+y08tAQd2ojtVOGjFTu75N1euSXyH3cV94Qy8S /uLg== X-Received: by 10.68.134.201 with SMTP id pm9mr10443115pbb.182.1361667064952; Sat, 23 Feb 2013 16:51:04 -0800 (PST) Received: from lustrous.fas.fa.disney.com (remote-11.disneyanimation.com. [198.187.190.11]) by mx.google.com with ESMTPS id a4sm8190345paw.21.2013.02.23.16.51.02 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 23 Feb 2013 16:51:04 -0800 (PST) X-Mailer: git-send-email 1.8.2.rc0.263.g20d9441 In-Reply-To: <1361667024-49776-12-git-send-email-davvid@gmail.com> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Follow the conventional Python style by using 4-space indents instead of hard tabs. Signed-off-by: David Aguilar --- contrib/fast-import/import-zips.py | 98 +++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/contrib/fast-import/import-zips.py b/contrib/fast-import/import-zips.py index b528798..d12c296 100755 --- a/contrib/fast-import/import-zips.py +++ b/contrib/fast-import/import-zips.py @@ -14,13 +14,13 @@ from time import mktime from zipfile import ZipFile if hexversion < 0x01060000: - # The limiter is the zipfile module - stderr.write("import-zips.py: requires Python 1.6.0 or later.\n") - exit(1) + # The limiter is the zipfile module + stderr.write("import-zips.py: requires Python 1.6.0 or later.\n") + exit(1) if len(argv) < 2: - print 'usage:', argv[0], '...' - exit(1) + print 'usage:', argv[0], '...' + exit(1) branch_ref = 'refs/heads/import-zips' committer_name = 'Z Ip Creator' @@ -28,51 +28,51 @@ committer_email = 'zip@example.com' fast_import = popen('git fast-import --quiet', 'w') def printlines(list): - for str in list: - fast_import.write(str + "\n") + for str in list: + fast_import.write(str + "\n") for zipfile in argv[1:]: - commit_time = 0 - next_mark = 1 - common_prefix = None - mark = dict() - - zip = ZipFile(zipfile, 'r') - for name in zip.namelist(): - if name.endswith('/'): - continue - info = zip.getinfo(name) - - if commit_time < info.date_time: - commit_time = info.date_time - if common_prefix == None: - common_prefix = name[:name.rfind('/') + 1] - else: - while not name.startswith(common_prefix): - last_slash = common_prefix[:-1].rfind('/') + 1 - common_prefix = common_prefix[:last_slash] - - mark[name] = ':' + str(next_mark) - next_mark += 1 - - printlines(('blob', 'mark ' + mark[name], \ - 'data ' + str(info.file_size))) - fast_import.write(zip.read(name) + "\n") - - committer = committer_name + ' <' + committer_email + '> %d +0000' % \ - mktime(commit_time + (0, 0, 0)) - - printlines(('commit ' + branch_ref, 'committer ' + committer, \ - 'data < %d +0000' % \ + mktime(commit_time + (0, 0, 0)) + + printlines(('commit ' + branch_ref, 'committer ' + committer, \ + 'data <