localrepo.walk: if we're walking a specific revision, sort the files
authorAlexis S. L. Carvalho <alexis@cecm.usp.br>
Sat, 10 Mar 2007 23:00:55 -0300
changeset 4194 8e947b0e53cc
parent 4193 dd0d9bd91e0a
child 4195 e8ee8fdeddb1
localrepo.walk: if we're walking a specific revision, sort the files This is more consistent with our behaviour while walking the working directory.
mercurial/localrepo.py
tests/test-locate.out
--- a/mercurial/localrepo.py	Sat Mar 10 23:00:54 2007 -0300
+++ b/mercurial/localrepo.py	Sat Mar 10 23:00:55 2007 -0300
@@ -832,7 +832,10 @@
 
         if node:
             fdict = dict.fromkeys(files)
-            for fn in self.manifest.read(self.changelog.read(node)[0]):
+            mdict = self.manifest.read(self.changelog.read(node)[0])
+            mfiles = mdict.keys()
+            mfiles.sort()
+            for fn in mfiles:
                 for ffn in fdict:
                     # match if the file is the exact name or a directory
                     if ffn == fn or fn.startswith("%s/" % ffn):
@@ -840,7 +843,9 @@
                         break
                 if match(fn):
                     yield 'm', fn
-            for fn in fdict:
+            ffiles = fdict.keys()
+            ffiles.sort()
+            for fn in ffiles:
                 if badmatch and badmatch(fn):
                     if match(fn):
                         yield 'b', fn
--- a/tests/test-locate.out	Sat Mar 10 23:00:54 2007 -0300
+++ b/tests/test-locate.out	Sat Mar 10 23:00:55 2007 -0300
@@ -16,9 +16,9 @@
 a
 NONEXISTENT: No such file in rev ce18e5bc5cd3
 a
-t/x
 b
 t.h
+t/x
 % -I/-X with relative path should work
 b
 t.h