diff mercurial/merge.py @ 18364:6252b4f1c4b4

subrepos: process subrepos in sorted order Add sorted() in places found by testing with PYTHONHASHSEED=random and code inspection. An alternative to sprinkling sorted() all over would be to change substate to a custom dict with sorted iterators...
author Mads Kiilerich <mads@kiilerich.com>
date Wed, 12 Dec 2012 02:38:14 +0100
parents 760c0d67ce5e
children 8a811fa9a9c0
line wrap: on
line diff
--- a/mercurial/merge.py	Tue Jan 15 02:59:12 2013 +0100
+++ b/mercurial/merge.py	Wed Dec 12 02:38:14 2012 +0100
@@ -222,7 +222,7 @@
 
     if '.hgsubstate' in m1:
         # check whether sub state is modified
-        for s in p1.substate:
+        for s in sorted(p1.substate):
             if p1.sub(s).dirty():
                 m1['.hgsubstate'] += "+"
                 break
@@ -593,7 +593,7 @@
             if not force and (wc.files() or wc.deleted()):
                 raise util.Abort(_("outstanding uncommitted changes"),
                                  hint=_("use 'hg status' to list changes"))
-            for s in wc.substate:
+            for s in sorted(wc.substate):
                 if wc.sub(s).dirty():
                     raise util.Abort(_("outstanding uncommitted changes in "
                                        "subrepository '%s'") % s)