diff mercurial/patch.py @ 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 3d6efcbbd1c9
children 3848488244fc 8b02af865990
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