changeset 2881:eab07a7b7491

fix patch.patch.filterfiles. now test-diff-subdir passes.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Sun, 13 Aug 2006 15:24:30 -0700
parents 51b8d1ca7820
children cf98cd70d2c4
files mercurial/patch.py
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/patch.py	Sun Aug 13 15:03:48 2006 -0700
+++ b/mercurial/patch.py	Sun Aug 13 15:24:30 2006 -0700
@@ -277,16 +277,15 @@
     modified, added, removed, deleted, unknown = changes
     if files:
         def filterfiles(filters):
-            l = [x for x in files if x in filters]
+            l = [x for x in filters if x in files]
 
-            for t in filters:
-                if t and t[-1] != "/":
+            for t in files:
+                if not t.endswith("/"):
                     t += "/"
-                l += [x for x in files if x.startswith(t)]
+                l += [x for x in filters if x.startswith(t)]
             return l
 
-        modified, added, removed = map(lambda x: filterfiles(x),
-                                       (modified, added, removed))
+        modified, added, removed = map(filterfiles, (modified, added, removed))
 
     if not modified and not added and not removed:
         return