Modify

Opened 7 years ago

#6952 new defect

revisions need to be sorted in order to add in correct order

Reported by: alonlevy1@… 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

Attachments (0)

Change History (0)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Kristian Kvilekval.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.