# HG changeset patch # User Greg Ward # Date 1312250959 14400 # Node ID efc96910ddf277af5946cfcd8dad7dd64d899081 # Parent c82b6a84884feca3d0389678c788272dfdd9781d Make --sourcesort work by assigning a sortkey to every commit. The sortkey is just the integer form of the 'mark' (cmd.id), which is probably not 100% correct, but good enough most of the time. (I'm assuming that most fast-exporters will export a monotonically increasing stream of commit IDs.) diff -r c82b6a84884f -r efc96910ddf2 hgfastimport/hgimport.py --- a/hgfastimport/hgimport.py Mon Aug 01 21:24:29 2011 -0400 +++ b/hgfastimport/hgimport.py Mon Aug 01 22:09:19 2011 -0400 @@ -316,7 +316,8 @@ date = self.convert_date(userinfo) parents = filter(None, [first_parent, second_parent]) - commit = common.commit(user, date, text, parents, branch, rev=cmd.id) + commit = common.commit(user, date, text, parents, branch, + rev=cmd.id, sortkey=int(cmd.id[1:])) self.commitmap[cmd.id] = commit heads = self.branchmap.get(branch)