Server IP : 103.119.228.120 / Your IP : 52.15.223.239 Web Server : Apache System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64 User : nobody ( 99) PHP Version : 5.6.40 Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/local/ssl/local/ssl/share/doc/git-1.8.3.1/contrib/fast-import/ |
Upload File : |
#!/usr/bin/env python ## zip archive frontend for git-fast-import ## ## For example: ## ## mkdir project; cd project; git init ## python import-zips.py *.zip ## git log --stat import-zips from os import popen, path from sys import argv, exit, hexversion, stderr 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) if len(argv) < 2: print 'usage:', argv[0], '<zipfile>...' exit(1) branch_ref = 'refs/heads/import-zips' committer_name = 'Z Ip Creator' 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 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', '')) if fast_import.close(): exit(1)