##// END OF EJS Templates
dirstate: don't check state of subrepo directories
Augie Fackler -
r10176:24ce8f0c default
parent child Browse files
Show More
@@ -32,7 +32,7 b' def timer(func, title=None):'
32 32 def perfwalk(ui, repo, *pats):
33 33 try:
34 34 m = cmdutil.match(repo, pats, {})
35 timer(lambda: len(list(repo.dirstate.walk(m, True, False))))
35 timer(lambda: len(list(repo.dirstate.walk(m, [], True, False))))
36 36 except:
37 37 try:
38 38 m = cmdutil.match(repo, pats, {})
@@ -150,4 +150,3 b' cmdtable = {'
150 150 'perftemplating': (perftemplating, []),
151 151 'perfdiffwd': (perfdiffwd, []),
152 152 }
153
@@ -42,11 +42,11 b' def reposetup(ui, repo):'
42 42 # to start an inotify server if it won't start.
43 43 _inotifyon = True
44 44
45 def status(self, match, ignored, clean, unknown=True):
45 def status(self, match, subrepos, ignored, clean, unknown=True):
46 46 files = match.files()
47 47 if '.' in files:
48 48 files = []
49 if self._inotifyon and not ignored and not self._dirty:
49 if self._inotifyon and not ignored and not subrepos and not self._dirty:
50 50 cli = client(ui, repo)
51 51 try:
52 52 result = cli.statusquery(files, match, False,
@@ -70,7 +70,7 b' def reposetup(ui, repo):'
70 70 result = r2
71 71 return result
72 72 return super(inotifydirstate, self).status(
73 match, ignored, clean, unknown)
73 match, subrepos, ignored, clean, unknown)
74 74
75 75 repo.dirstate.__class__ = inotifydirstate
76 76
@@ -638,7 +638,8 b' class workingctx(changectx):'
638 638 return self._parents[0].ancestor(c2) # punt on two parents for now
639 639
640 640 def walk(self, match):
641 return sorted(self._repo.dirstate.walk(match, True, False))
641 return sorted(self._repo.dirstate.walk(match, self.substate.keys(),
642 True, False))
642 643
643 644 def dirty(self, missing=False):
644 645 "check whether a working directory is modified"
@@ -425,7 +425,7 b' class dirstate(object):'
425 425 return True
426 426 return False
427 427
428 def walk(self, match, unknown, ignored):
428 def walk(self, match, subrepos, unknown, ignored):
429 429 '''
430 430 Walk recursively through the directory tree, finding all files
431 431 matched by match.
@@ -486,7 +486,8 b' class dirstate(object):'
486 486 files = set(match.files())
487 487 if not files or '.' in files:
488 488 files = ['']
489 results = {'.hg': None}
489 results = dict.fromkeys(subrepos)
490 results['.hg'] = None
490 491
491 492 # step 1: find all explicit files
492 493 for ff in sorted(files):
@@ -564,11 +565,12 b' class dirstate(object):'
564 565 if not st is None and not getkind(st.st_mode) in (regkind, lnkkind):
565 566 st = None
566 567 results[nf] = st
567
568 for s in subrepos:
569 del results[s]
568 570 del results['.hg']
569 571 return results
570 572
571 def status(self, match, ignored, clean, unknown):
573 def status(self, match, subrepos, ignored, clean, unknown):
572 574 '''Determine the status of the working copy relative to the
573 575 dirstate and return a tuple of lists (unsure, modified, added,
574 576 removed, deleted, unknown, ignored, clean), where:
@@ -609,7 +611,8 b' class dirstate(object):'
609 611 dadd = deleted.append
610 612 cadd = clean.append
611 613
612 for fn, st in self.walk(match, listunknown, listignored).iteritems():
614 for fn, st in self.walk(match, subrepos, listunknown,
615 listignored).iteritems():
613 616 if fn not in dmap:
614 617 if (listignored or match.exact(fn)) and self._dirignore(fn):
615 618 if listignored:
@@ -1000,7 +1000,9 b' class localrepository(repo.repository):'
1000 1000 match.bad = bad
1001 1001
1002 1002 if working: # we need to scan the working dir
1003 s = self.dirstate.status(match, listignored, listclean, listunknown)
1003 subrepos = ctx1.substate.keys()
1004 s = self.dirstate.status(match, subrepos, listignored,
1005 listclean, listunknown)
1004 1006 cmp, modified, added, removed, deleted, unknown, ignored, clean = s
1005 1007
1006 1008 # check for any possibly clean files
General Comments 0
You need to be logged in to leave comments. Login now