convert: stabilize subversion date sorter
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 29 Aug 2023 22:13:18 +0200
changeset 50910 8edfd28a01d1
parent 50909 12476986d89c
child 50911 93cc085653fb
convert: stabilize subversion date sorter In case of tie, this provides unstable result on my system. So I am adding a couple of tie breaker to fix the test.
hgext/convert/convcmd.py
--- a/hgext/convert/convcmd.py	Thu Aug 31 19:47:33 2023 -0400
+++ b/hgext/convert/convcmd.py	Tue Aug 29 22:13:18 2023 +0200
@@ -435,7 +435,13 @@
             """Sort revisions by date."""
 
             def getdate(n):
-                return dateutil.parsedate(self.commitcache[n].date)
+                commit = self.commitcache[n]
+                # The other entries are here as tie breaker for stability
+                return (
+                    dateutil.parsedate(commit.date),
+                    commit.rev,
+                    commit.branch,
+                )
 
             return keysorter(getdate)