without attic allow current revision not to exist
This commit is contained in:
parent
51a50e8ed7
commit
20a9c08bee
1 changed files with 7 additions and 1 deletions
|
@ -189,7 +189,6 @@ def convertfile(pagedir, output = None, overwrite = False):
|
||||||
page = Page(request, pagename, rev = rev)
|
page = Page(request, pagename, rev = rev)
|
||||||
pagefile, realrev, exists = page.get_rev(rev = rev);
|
pagefile, realrev, exists = page.get_rev(rev = rev);
|
||||||
|
|
||||||
content = moin2doku(pagename, page.get_raw_body())
|
|
||||||
mtime = page.mtime_usecs() / USEC
|
mtime = page.mtime_usecs() / USEC
|
||||||
|
|
||||||
if not mtime:
|
if not mtime:
|
||||||
|
@ -203,9 +202,16 @@ def convertfile(pagedir, output = None, overwrite = False):
|
||||||
|
|
||||||
if rev == current_rev:
|
if rev == current_rev:
|
||||||
out_file = os.path.join(output_dir, 'pages', dw.wikiFN(output))
|
out_file = os.path.join(output_dir, 'pages', dw.wikiFN(output))
|
||||||
|
if not convert_attic and not exists:
|
||||||
|
# if not converting attic, allow current version may not exist anymore
|
||||||
|
continue
|
||||||
else:
|
else:
|
||||||
out_file = os.path.join(output_dir, 'attic', dw.wikiFN(output, str(mtime)))
|
out_file = os.path.join(output_dir, 'attic', dw.wikiFN(output, str(mtime)))
|
||||||
|
|
||||||
|
content = moin2doku(pagename, page.get_raw_body())
|
||||||
|
if len(content) == 0:
|
||||||
|
raise Exception, "No content"
|
||||||
|
|
||||||
writefile(out_file, content, overwrite = overwrite)
|
writefile(out_file, content, overwrite = overwrite)
|
||||||
copystat(pagefile, out_file)
|
copystat(pagefile, out_file)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue