Mercurial > hg > hg-fastimport
diff hgfastimport/hgimport.py @ 60:efc96910ddf2
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.)
| author | Greg Ward <gward@intelerad.com> |
|---|---|
| date | Mon, 01 Aug 2011 22:09:19 -0400 |
| parents | c82b6a84884f |
| children |
line wrap: on
line diff
--- 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)
