log: fix log revset instability stable
authorDurham Goode <durham@fb.com>
Mon, 08 Dec 2014 15:41:54 -0800
branchstable
changeset 23501 424d669118d3
parent 23500 9601229ed361
child 23509 32e68271a037
child 23592 96d335e4eacb
log: fix log revset instability The log/graphlog revset was not producing stable results since it was iterating over a dict. Now we sort before iterating to guarantee a fixed order. This fixes some potential flakiness in the tests.
mercurial/cmdutil.py
tests/test-glog.t
--- a/mercurial/cmdutil.py	Fri Dec 05 14:27:32 2014 -0800
+++ b/mercurial/cmdutil.py	Mon Dec 08 15:41:54 2014 -0800
@@ -1795,7 +1795,7 @@
                 filematcher = lambda rev: match
 
     expr = []
-    for op, val in opts.iteritems():
+    for op, val in sorted(opts.iteritems()):
         if not val:
             continue
         if op not in opt2revset:
--- a/tests/test-glog.t	Fri Dec 05 14:27:32 2014 -0800
+++ b/tests/test-glog.t	Mon Dec 08 15:41:54 2014 -0800
@@ -1660,15 +1660,15 @@
   (group
     (and
       (func
+        ('symbol', 'ancestors')
+        ('symbol', '.'))
+      (func
         ('symbol', '_matchfiles')
         (list
           (list
             ('string', 'r:')
             ('string', 'd:relpath'))
-          ('string', 'p:dir')))
-      (func
-        ('symbol', 'ancestors')
-        ('symbol', '.'))))
+          ('string', 'p:dir')))))
   $ hg up -q tip
 
 Test --follow on file not in parent revision
@@ -1685,15 +1685,15 @@
   (group
     (and
       (func
+        ('symbol', 'ancestors')
+        ('symbol', '.'))
+      (func
         ('symbol', '_matchfiles')
         (list
           (list
             ('string', 'r:')
             ('string', 'd:relpath'))
-          ('string', 'p:glob:*')))
-      (func
-        ('symbol', 'ancestors')
-        ('symbol', '.'))))
+          ('string', 'p:glob:*')))))
 
 Test --follow on a single rename
 
@@ -1862,15 +1862,15 @@
   (group
     (and
       (func
+        ('symbol', 'ancestors')
+        ('symbol', '.'))
+      (func
         ('symbol', '_matchfiles')
         (list
           (list
             ('string', 'r:')
             ('string', 'd:relpath'))
-          ('string', 'p:a')))
-      (func
-        ('symbol', 'ancestors')
-        ('symbol', '.'))))
+          ('string', 'p:a')))))
 
 Test --patch and --stat with --follow and --follow-first