# HG changeset patch # User Benoit Boissinot # Date 1137599705 -3600 # Node ID f2b1df3dbcbbde87e1d384e60137b34e6ae2abc3 # Parent e1bcf7fa983f293e17936cc8eb46453152e806b1 make the order of the arguments for filterfiles consistent fix a bug where the order was reversed diff --git a/contrib/hgk.py b/contrib/hgk.py --- a/contrib/hgk.py +++ b/contrib/hgk.py @@ -17,7 +17,7 @@ def dodiff(fp, ui, repo, node1, node2, f 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: diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -266,7 +266,7 @@ def dodiff(fp, ui, repo, node1, node2, f 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: diff --git a/mercurial/hgweb.py b/mercurial/hgweb.py --- a/mercurial/hgweb.py +++ b/mercurial/hgweb.py @@ -226,13 +226,13 @@ class hgweb(object): 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 @@ class hgweb(object): 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: