# HG changeset patch # User Sean Farley # Date 1394581124 18000 # Node ID 6c90a18dd926e6975e2e81eb06de7da4f21b9edb # Parent 3b1ec3d4ece69da45d3a30235fa9f072b73d3cd9 localrepo: use _manifestmatches instead of duplicating logic diff -r 3b1ec3d4ece6 -r 6c90a18dd926 mercurial/localrepo.py --- a/mercurial/localrepo.py Wed Apr 23 20:52:10 2014 -0500 +++ b/mercurial/localrepo.py Tue Mar 11 18:38:44 2014 -0500 @@ -1511,15 +1511,6 @@ If node2 is None, compare node1 with working directory. """ - def mfmatches(ctx): - mf = ctx.manifest().copy() - if match.always(): - return mf - for fn in mf.keys(): - if not match(fn): - del mf[fn] - return mf - ctx1 = self[node1] ctx2 = self[node2] @@ -1566,11 +1557,11 @@ modified, added, removed, deleted, unknown, ignored, clean = r if not parentworking: - mf1 = mfmatches(ctx1) + mf1 = ctx1._manifestmatches(match, r) if working: # we are comparing working dir against non-parent # generate a pseudo-manifest for the working dir - mf2 = mfmatches(self['.']) + mf2 = self['.']._manifestmatches(match, r) for f in modified + added: mf2[f] = None mf2.set(f, ctx2.flags(f)) @@ -1580,7 +1571,7 @@ else: # we are comparing two revisions deleted, unknown, ignored = [], [], [] - mf2 = mfmatches(ctx2) + mf2 = ctx2._manifestmatches(match, r) modified, added, clean = [], [], [] withflags = mf1.withflags() | mf2.withflags()