Mercurial > public > mercurial-scm > hg-stable
comparison 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 |
comparison
equal
deleted
inserted
replaced
2880:51b8d1ca7820 | 2881:eab07a7b7491 |
---|---|
275 if not changes: | 275 if not changes: |
276 changes = repo.status(node1, node2, files, match=match)[:5] | 276 changes = repo.status(node1, node2, files, match=match)[:5] |
277 modified, added, removed, deleted, unknown = changes | 277 modified, added, removed, deleted, unknown = changes |
278 if files: | 278 if files: |
279 def filterfiles(filters): | 279 def filterfiles(filters): |
280 l = [x for x in files if x in filters] | 280 l = [x for x in filters if x in files] |
281 | 281 |
282 for t in filters: | 282 for t in files: |
283 if t and t[-1] != "/": | 283 if not t.endswith("/"): |
284 t += "/" | 284 t += "/" |
285 l += [x for x in files if x.startswith(t)] | 285 l += [x for x in filters if x.startswith(t)] |
286 return l | 286 return l |
287 | 287 |
288 modified, added, removed = map(lambda x: filterfiles(x), | 288 modified, added, removed = map(filterfiles, (modified, added, removed)) |
289 (modified, added, removed)) | |
290 | 289 |
291 if not modified and not added and not removed: | 290 if not modified and not added and not removed: |
292 return | 291 return |
293 | 292 |
294 if node2: | 293 if node2: |