comparison mercurial/localrepo.py @ 16646:a1dcd842ce17

localrepo: optimize internode status calls using withflags Introduce manifestdict.withflags() to get a set of all files which have any flags set, since these are likely to be a minority. Otherwise checking .flags() for every file is a lot of dictionary lookups and is quite slow.
author Jesse Glick <jesse.glick@oracle.com>
date Fri, 04 May 2012 15:56:45 -0400
parents 9a21fc2c7d32
children b6081c2c4647
comparison
equal deleted inserted replaced
16645:9a21fc2c7d32 16646:a1dcd842ce17
1418 # we are comparing two revisions 1418 # we are comparing two revisions
1419 deleted, unknown, ignored = [], [], [] 1419 deleted, unknown, ignored = [], [], []
1420 mf2 = mfmatches(ctx2) 1420 mf2 = mfmatches(ctx2)
1421 1421
1422 modified, added, clean = [], [], [] 1422 modified, added, clean = [], [], []
1423 withflags = mf1.withflags() | mf2.withflags()
1423 for fn in mf2: 1424 for fn in mf2:
1424 if fn in mf1: 1425 if fn in mf1:
1425 if (fn not in deleted and 1426 if (fn not in deleted and
1426 (mf1.flags(fn) != mf2.flags(fn) or 1427 ((fn in withflags and mf1.flags(fn) != mf2.flags(fn)) or
1427 (mf1[fn] != mf2[fn] and 1428 (mf1[fn] != mf2[fn] and
1428 (mf2[fn] or ctx1[fn].cmp(ctx2[fn]))))): 1429 (mf2[fn] or ctx1[fn].cmp(ctx2[fn]))))):
1429 modified.append(fn) 1430 modified.append(fn)
1430 elif listclean: 1431 elif listclean:
1431 clean.append(fn) 1432 clean.append(fn)