-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'da/downcase-u-in-usage' into maint
* da/downcase-u-in-usage: contrib/mw-to-git/t/install-wiki.sh: use a lowercase "usage:" string contrib/examples/git-remote.perl: use a lowercase "usage:" string tests: use a lowercase "usage:" string git-svn: use a lowercase "usage:" string Documentation/user-manual.txt: use a lowercase "usage:" string templates/hooks--update.sample: use a lowercase "usage:" string contrib/hooks/setgitperms.perl: use a lowercase "usage:" string contrib/examples: use a lowercase "usage:" string contrib/fast-import/import-zips.py: use spaces instead of tabs contrib/fast-import/import-zips.py: fix broken error message contrib/fast-import: use a lowercase "usage:" string contrib/credential: use a lowercase "usage:" string git-cvsimport: use a lowercase "usage:" string git-cvsimport: use a lowercase "usage:" string git-cvsexportcommit: use a lowercase "usage:" string git-archimport: use a lowercase "usage:" string git-merge-one-file: use a lowercase "usage:" string git-relink: use a lowercase "usage:" string git-svn: use a lowercase "usage:" string git-sh-setup: use a lowercase "usage:" string
- Loading branch information
Showing
25 changed files
with
82 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,65 +14,65 @@ | |
from zipfile import ZipFile | ||
|
||
if hexversion < 0x01060000: | ||
# The limiter is the zipfile module | ||
sys.stderr.write("import-zips.py: requires Python 1.6.0 or later.\n") | ||
sys.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], '<zipfile>...' | ||
exit(1) | ||
print 'usage:', argv[0], '<zipfile>...' | ||
exit(1) | ||
|
||
branch_ref = 'refs/heads/import-zips' | ||
committer_name = 'Z Ip Creator' | ||
committer_email = '[email protected]' | ||
|
||
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 <<EOM', 'Imported from ' + zipfile + '.', 'EOM', \ | ||
'', 'deleteall')) | ||
|
||
for name in mark.keys(): | ||
fast_import.write('M 100644 ' + mark[name] + ' ' + | ||
name[len(common_prefix):] + "\n") | ||
|
||
printlines(('', 'tag ' + path.basename(zipfile), \ | ||
'from ' + branch_ref, 'tagger ' + committer, \ | ||
'data <<EOM', 'Package ' + zipfile, 'EOM', '')) | ||
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 <<EOM', 'Imported from ' + zipfile + '.', 'EOM', \ | ||
'', 'deleteall')) | ||
|
||
for name in mark.keys(): | ||
fast_import.write('M 100644 ' + mark[name] + ' ' + | ||
name[len(common_prefix):] + "\n") | ||
|
||
printlines(('', 'tag ' + path.basename(zipfile), \ | ||
'from ' + branch_ref, 'tagger ' + committer, \ | ||
'data <<EOM', 'Package ' + zipfile, 'EOM', '')) | ||
|
||
if fast_import.close(): | ||
exit(1) | ||
exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters