# HG changeset patch # User Augie Fackler # Date 1528842265 14400 # Node ID 80f6e95fac2d17b27f944025ed1ce599443467e6 # Parent 9f56ad50924d591190cecd8c488ede3b88421d07 cvsps: avoid comparison between None and a tuple in date sorting Avoids badness on Python 3. I had to figure out which entries in this object *could* be None experimentally, but I think I've got them all now. Differential Revision: https://phab.mercurial-scm.org/D3723 diff -r 9f56ad50924d -r 80f6e95fac2d hgext/convert/cvsps.py --- a/hgext/convert/cvsps.py Tue Jun 12 18:21:41 2018 -0400 +++ b/hgext/convert/cvsps.py Tue Jun 12 18:24:25 2018 -0400 @@ -567,11 +567,15 @@ mindate = {} for e in log: if e.commitid: - mindate[e.commitid] = min(e.date, mindate.get(e.commitid)) + if e.commitid not in mindate: + mindate[e.commitid] = e.date + else: + mindate[e.commitid] = min(e.date, mindate[e.commitid]) # Merge changesets - log.sort(key=lambda x: (mindate.get(x.commitid), x.commitid, x.comment, - x.author, x.branch, x.date, x.branchpoints)) + log.sort(key=lambda x: (mindate.get(x.commitid, (-1, 0)), + x.commitid or '', x.comment, + x.author, x.branch or '', x.date, x.branchpoints)) changesets = [] files = set()