simplify fast-import flow
This commit is contained in:
parent
695d460665
commit
839f2f86e9
|
@ -62,7 +62,7 @@ def main():
|
||||||
os.chdir(path)
|
os.chdir(path)
|
||||||
|
|
||||||
# Create fast-import data stream
|
# Create fast-import data stream
|
||||||
with open('fast-import-data', 'w+b') as fid:
|
with open('fast-import-data', 'wb') as fid:
|
||||||
fid.write('reset refs/heads/master\n')
|
fid.write('reset refs/heads/master\n')
|
||||||
for rev in page.revisions(dir='newer', prop='ids|timestamp|flags|comment|user|content'):
|
for rev in page.revisions(dir='newer', prop='ids|timestamp|flags|comment|user|content'):
|
||||||
id = rev['revid']
|
id = rev['revid']
|
||||||
|
@ -82,10 +82,7 @@ def main():
|
||||||
|
|
||||||
if args.doimport:
|
if args.doimport:
|
||||||
sp.check_call(['git','init','--bare'])
|
sp.check_call(['git','init','--bare'])
|
||||||
fid.seek(0, 0)
|
sp.check_call(['git', 'fast-import','--quiet'], stdin=open(fid.name,"rb"))
|
||||||
sp.check_call(['git', 'fast-import','--quiet'], stdin=fid)
|
|
||||||
|
|
||||||
if args.doimport:
|
|
||||||
os.unlink('fast-import-data')
|
os.unlink('fast-import-data')
|
||||||
|
|
||||||
if __name__=='__main__':
|
if __name__=='__main__':
|
||||||
|
|
Loading…
Reference in New Issue