Mercurial > hg > mercurial-source
diff hgext/largefiles/overrides.py @ 32433:1af4a1641bdb
largefiles: avoid redundant changectx looking up at each repetitions
These code paths look up changectx at each repetitions, even though
the changectx key isn't changed while loop.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Mon, 27 Mar 2017 09:44:35 +0900 |
parents | 32d998dc2a00 |
children | 9d075911df49 |
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -759,11 +759,12 @@ lfdirstate = lfutil.openlfdirstate(mctx.repo().ui, mctx.repo(), False) + wctx = repo[None] def tostandin(f): standin = lfutil.standin(f) if standin in ctx or standin in mctx: return standin - elif standin in repo[None] or lfdirstate[f] == 'r': + elif standin in wctx or lfdirstate[f] == 'r': return None return f m._files = [tostandin(f) for f in m._files] @@ -1077,8 +1078,9 @@ s = repo.status(match=m, clean=True) finally: repo.lfstatus = False + manifest = repo[None].manifest() forget = sorted(s.modified + s.added + s.deleted + s.clean) - forget = [f for f in forget if lfutil.standin(f) in repo[None].manifest()] + forget = [f for f in forget if lfutil.standin(f) in manifest] for f in forget: fstandin = lfutil.standin(f)