comparison mercurial/localrepo.py @ 21399:3b6b1b407e99

localrepo: call _dirstatestatus instead of duplicating logic
author Sean Farley <sean.michael.farley@gmail.com>
date Tue, 11 Mar 2014 18:32:16 -0500
parents f251b92d9ed9
children 242637139efb
comparison
equal deleted inserted replaced
21398:ed608a544719 21399:3b6b1b407e99
1539 if f not in ctx1 and f not in ctx1.dirs(): 1539 if f not in ctx1 and f not in ctx1.dirs():
1540 self.ui.warn('%s: %s\n' % (self.dirstate.pathto(f), msg)) 1540 self.ui.warn('%s: %s\n' % (self.dirstate.pathto(f), msg))
1541 match.bad = bad 1541 match.bad = bad
1542 1542
1543 if working: # we need to scan the working dir 1543 if working: # we need to scan the working dir
1544 subrepos = [] 1544 r = ctx2._dirstatestatus(match=match, ignored=listignored,
1545 if '.hgsub' in self.dirstate: 1545 clean=listclean, unknown=listunknown)
1546 subrepos = sorted(ctx2.substate) 1546 modified, added, removed, deleted, unknown, ignored, clean = r
1547 s = self.dirstate.status(match, subrepos, listignored,
1548 listclean, listunknown)
1549 cmp, modified, added, removed, deleted, unknown, ignored, clean = s
1550
1551 # check for any possibly clean files
1552 if parentworking and cmp:
1553 modified2, fixup = ctx2._checklookup(cmp)
1554 modified += modified2
1555
1556 # update dirstate for files that are actually clean
1557 if fixup and listclean:
1558 clean += fixup
1559 1547
1560 if not parentworking: 1548 if not parentworking:
1561 mf1 = mfmatches(ctx1) 1549 mf1 = mfmatches(ctx1)
1562 if working: 1550 if working:
1563 # we are comparing working dir against non-parent 1551 # we are comparing working dir against non-parent
1564 # generate a pseudo-manifest for the working dir 1552 # generate a pseudo-manifest for the working dir
1565 mf2 = mfmatches(self['.']) 1553 mf2 = mfmatches(self['.'])
1566 for f in cmp + modified + added: 1554 for f in modified + added:
1567 mf2[f] = None 1555 mf2[f] = None
1568 mf2.set(f, ctx2.flags(f)) 1556 mf2.set(f, ctx2.flags(f))
1569 for f in removed: 1557 for f in removed:
1570 if f in mf2: 1558 if f in mf2:
1571 del mf2[f] 1559 del mf2[f]