Opened 15 years ago
#6952 new defect
revisions need to be sorted in order to add in correct order
Reported by: | Owned by: | Kristian Kvilekval | |
---|---|---|---|
Priority: | normal | Component: | MoinToTracScript |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
Before this patch the revisions are added in the order os.listdir(revdir) returned, which is not always (and quite often in fact isn't) according to the revision order.
This oneliner fixes the issue: (you can remove the list there actually)
diff --git a/moin2trac.py b/moin2trac.py index da320d3..110ea7e 100755 --- a/moin2trac.py +++ b/moin2trac.py @@ -55,7 +55,7 @@ def convert(moindir, tracdir = None, mapfile = None):
admin.env_set (wikidir) revdir = moindir + '/' + page + '/revisions' if os.access(revdir, os.F_OK):
- revisions = os.listdir(revdir)
+ revisions = list(sorted(os.listdir(revdir)))
for rev in revisions:
cmd='wiki import %s %s' % ( recodeName(page), revdir +'/'+rev) print cmd, "->", wikidir