[PATCH 3 of 3] ignore: process hgignore files in deterministic order

Bryan O'Sullivan bos at serpentine.com
Mon Dec 17 18:30:03 CST 2012


# HG changeset patch
# User Bryan O'Sullivan <bryano at fb.com>
# Date 1355788622 28800
# Node ID d1022684cdeaa3764f8f95658372b4155e7a96bd
# Parent  588d2a23ca25b43dd4afd1a194343635a1255992
ignore: process hgignore files in deterministic order

Previously, we processed them in whatever order the dict iterator gave us.

diff --git a/mercurial/ignore.py b/mercurial/ignore.py
--- a/mercurial/ignore.py
+++ b/mercurial/ignore.py
@@ -70,7 +70,7 @@
             if f != files[0]:
                 warn(_("skipping unreadable ignore file '%s': %s\n") %
                      (f, inst.strerror))
-    return pats
+    return [(f, pats[f]) for f in files if f in pats]
 
 def ignore(root, files, warn):
     '''return matcher covering patterns in 'files'.
@@ -95,7 +95,7 @@
     pats = readpats(root, files, warn)
 
     allpats = []
-    for patlist in pats.values():
+    for f, patlist in pats:
         allpats.extend(patlist)
     if not allpats:
         return util.never
@@ -104,7 +104,7 @@
         ignorefunc = match.match(root, '', [], allpats)
     except util.Abort:
         # Re-raise an exception where the src is the right file
-        for f, patlist in pats.iteritems():
+        for f, patlist in pats:
             try:
                 match.match(root, '', [], patlist)
             except util.Abort, inst:


More information about the Mercurial-devel mailing list