Patchwork [11,of,24] obsolete: process markers in a stable order

login
register
mail settings
Submitter Mads Kiilerich
Date Dec. 16, 2012, 10:34 p.m.
Message ID <f886abbb6947d813813d.1355697246@localhost6.localdomain6>
Download mbox | patch
Permalink /patch/135/
State Accepted
Commit 4148414da12048cd97e1c73e926bb465bda7cfa2
Headers show

Comments

Mads Kiilerich - Dec. 16, 2012, 10:34 p.m.
# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1355687456 -3600
# Node ID f886abbb6947d813813df8c3edeb83af6923cd7a
# Parent  3736a972c5892ad69f851e7cdf08b835629257de
obsolete: process markers in a stable order

Using set iteration order gave unstable debugsuccessorssets output with
PYTHONHASHSEED=random.
Bryan O'Sullivan - Dec. 17, 2012, 8:59 p.m.
On Sun, Dec 16, 2012 at 2:34 PM, Mads Kiilerich <mads at kiilerich.com> wrote:

> obsolete: process markers in a stable order
>

Looks good, thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20121217/3a121aee/attachment.html>

Patch

diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -526,7 +526,7 @@ 
             #   Having none means pruned node, multiple successors means split,
             #   single successors are standard replacement.
             #
-            for mark in succmarkers[current]:
+            for mark in sorted(succmarkers[current]):
                 for suc in mark[1]:
                     if suc not in cache:
                         if suc in stackedset:
@@ -563,7 +563,7 @@ 
                 # duplicated entry and successors set that are strict subset of
                 # another one.
                 succssets = []
-                for mark in succmarkers[current]:
+                for mark in sorted(succmarkers[current]):
                     # successors sets contributed by this marker
                     markss = [[]]
                     for suc in mark[1]:
diff --git a/tests/test-obsolete-divergent.t b/tests/test-obsolete-divergent.t
--- a/tests/test-obsolete-divergent.t
+++ b/tests/test-obsolete-divergent.t
@@ -75,8 +75,8 @@ 
   d20a80d4def3
       d20a80d4def3
   007dc284c1f8
+      82623d38b9ba
       392fd25390da
-      82623d38b9ba
   82623d38b9ba
       82623d38b9ba
   392fd25390da
@@ -121,8 +121,8 @@ 
   d20a80d4def3
       d20a80d4def3
   007dc284c1f8
+      82623d38b9ba
       01f36c5a8fda
-      82623d38b9ba
   82623d38b9ba
       82623d38b9ba
   392fd25390da
@@ -155,8 +155,8 @@ 
   d20a80d4def3
       d20a80d4def3
   007dc284c1f8
+      82623d38b9ba
       392fd25390da
-      82623d38b9ba
   82623d38b9ba
       82623d38b9ba
   392fd25390da