Mercurial > hg
comparison hgext/convert/cvsps.py @ 18718:c8c3887a24c1
convert: stabilize cvsps commitid sort order
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 22 Feb 2013 16:40:27 -0600 |
parents | cfbd33020066 |
children | 0a12e5f3a979 |
comparison
equal
deleted
inserted
replaced
18717:fcc4b55876c3 | 18718:c8c3887a24c1 |
---|---|
506 def createchangeset(ui, log, fuzz=60, mergefrom=None, mergeto=None): | 506 def createchangeset(ui, log, fuzz=60, mergefrom=None, mergeto=None): |
507 '''Convert log into changesets.''' | 507 '''Convert log into changesets.''' |
508 | 508 |
509 ui.status(_('creating changesets\n')) | 509 ui.status(_('creating changesets\n')) |
510 | 510 |
511 # try to order commitids by date | |
512 mindate = {} | |
513 for e in log: | |
514 if e.commitid: | |
515 mindate[e.commitid] = min(e.date, mindate.get(e.commitid)) | |
516 | |
511 # Merge changesets | 517 # Merge changesets |
512 log.sort(key=lambda x: (x.commitid, x.comment, x.author, x.branch, x.date, | 518 log.sort(key=lambda x: (mindate.get(x.commitid), x.commitid, x.comment, |
513 x.branchpoints)) | 519 x.author, x.branch, x.date, x.branchpoints)) |
514 | 520 |
515 changesets = [] | 521 changesets = [] |
516 files = set() | 522 files = set() |
517 c = None | 523 c = None |
518 for i, e in enumerate(log): | 524 for i, e in enumerate(log): |