diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -32,7 +32,7 @@ def timer(func, title=None): def perfwalk(ui, repo, *pats): try: m = cmdutil.match(repo, pats, {}) - timer(lambda: len(list(repo.dirstate.walk(m, True, False)))) + timer(lambda: len(list(repo.dirstate.walk(m, [], True, False)))) except: try: m = cmdutil.match(repo, pats, {}) @@ -150,4 +150,3 @@ cmdtable = { 'perftemplating': (perftemplating, []), 'perfdiffwd': (perfdiffwd, []), } - diff --git a/hgext/inotify/__init__.py b/hgext/inotify/__init__.py --- a/hgext/inotify/__init__.py +++ b/hgext/inotify/__init__.py @@ -42,11 +42,11 @@ def reposetup(ui, repo): # to start an inotify server if it won't start. _inotifyon = True - def status(self, match, ignored, clean, unknown=True): + def status(self, match, subrepos, ignored, clean, unknown=True): files = match.files() if '.' in files: files = [] - if self._inotifyon and not ignored and not self._dirty: + if self._inotifyon and not ignored and not subrepos and not self._dirty: cli = client(ui, repo) try: result = cli.statusquery(files, match, False, @@ -70,7 +70,7 @@ def reposetup(ui, repo): result = r2 return result return super(inotifydirstate, self).status( - match, ignored, clean, unknown) + match, subrepos, ignored, clean, unknown) repo.dirstate.__class__ = inotifydirstate diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -638,7 +638,8 @@ class workingctx(changectx): return self._parents[0].ancestor(c2) # punt on two parents for now def walk(self, match): - return sorted(self._repo.dirstate.walk(match, True, False)) + return sorted(self._repo.dirstate.walk(match, self.substate.keys(), + True, False)) def dirty(self, missing=False): "check whether a working directory is modified" diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -425,7 +425,7 @@ class dirstate(object): return True return False - def walk(self, match, unknown, ignored): + def walk(self, match, subrepos, unknown, ignored): ''' Walk recursively through the directory tree, finding all files matched by match. @@ -486,7 +486,8 @@ class dirstate(object): files = set(match.files()) if not files or '.' in files: files = [''] - results = {'.hg': None} + results = dict.fromkeys(subrepos) + results['.hg'] = None # step 1: find all explicit files for ff in sorted(files): @@ -564,11 +565,12 @@ class dirstate(object): if not st is None and not getkind(st.st_mode) in (regkind, lnkkind): st = None results[nf] = st - + for s in subrepos: + del results[s] del results['.hg'] return results - def status(self, match, ignored, clean, unknown): + def status(self, match, subrepos, ignored, clean, unknown): '''Determine the status of the working copy relative to the dirstate and return a tuple of lists (unsure, modified, added, removed, deleted, unknown, ignored, clean), where: @@ -609,7 +611,8 @@ class dirstate(object): dadd = deleted.append cadd = clean.append - for fn, st in self.walk(match, listunknown, listignored).iteritems(): + for fn, st in self.walk(match, subrepos, listunknown, + listignored).iteritems(): if fn not in dmap: if (listignored or match.exact(fn)) and self._dirignore(fn): if listignored: diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1000,7 +1000,9 @@ class localrepository(repo.repository): match.bad = bad if working: # we need to scan the working dir - s = self.dirstate.status(match, listignored, listclean, listunknown) + subrepos = ctx1.substate.keys() + s = self.dirstate.status(match, subrepos, listignored, + listclean, listunknown) cmp, modified, added, removed, deleted, unknown, ignored, clean = s # check for any possibly clean files