changeset 1626:f2b1df3dbcbb

make the order of the arguments for filterfiles consistent fix a bug where the order was reversed
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Wed, 18 Jan 2006 16:55:05 +0100
parents e1bcf7fa983f
children 11cd38286fdb
files contrib/hgk.py mercurial/commands.py mercurial/hgweb.py
diffstat 3 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/hgk.py	Tue Jan 17 16:10:22 2006 +0100
+++ b/contrib/hgk.py	Wed Jan 18 16:55:05 2006 +0100
@@ -17,7 +17,7 @@
         changes = repo.changes(node1, node2, files, match=match)
     modified, added, removed, deleted, unknown = changes
     if files:
-        modified, added, removed = map(lambda x: filterfiles(x, files),
+        modified, added, removed = map(lambda x: filterfiles(files, x),
                                        (modified, added, removed))
 
     if not modified and not added and not removed:
--- a/mercurial/commands.py	Tue Jan 17 16:10:22 2006 +0100
+++ b/mercurial/commands.py	Wed Jan 18 16:55:05 2006 +0100
@@ -266,7 +266,7 @@
         changes = repo.changes(node1, node2, files, match=match)
     modified, added, removed, deleted, unknown = changes
     if files:
-        modified, added, removed = map(lambda x: filterfiles(x, files),
+        modified, added, removed = map(lambda x: filterfiles(files, x),
                                        (modified, added, removed))
 
     if not modified and not added and not removed:
--- a/mercurial/hgweb.py	Tue Jan 17 16:10:22 2006 +0100
+++ b/mercurial/hgweb.py	Wed Jan 18 16:55:05 2006 +0100
@@ -226,13 +226,13 @@
              yield self.t(t1, tag=t, **args)
 
     def diff(self, node1, node2, files):
-        def filterfiles(list, files):
-            l = [x for x in list if x in files]
+        def filterfiles(filters, files):
+            l = [x for x in list if x in filters]
 
-            for f in files:
-                if f[-1] != os.sep:
-                    f += os.sep
-                l += [x for x in list if x.startswith(f)]
+            for t in filters:
+                if t[-1] != os.sep:
+                    t += os.sep
+                l += [x for x in files if x.startswith(t)]
             return l
 
         parity = [0]
@@ -267,7 +267,7 @@
 
         modified, added, removed, deleted, unknown = r.changes(node1, node2)
         if files:
-            modified, added, removed = map(lambda x: filterfiles(x, files),
+            modified, added, removed = map(lambda x: filterfiles(files, x),
                                            (modified, added, removed))
 
         for f in modified: