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