Mercurial > public > mercurial-scm > hg-stable
diff mercurial/narrowspec.py @ 47314:e4ccc341e65b
narrow: widen when files are excluded by sparse and not included by narrow
In a repo where some directories are included by narrow and the complement are
excluded by sparse, it was previously impossible to widen either because trying
to widen narrow would complain that the requested files are outside the sparse
checkout and trying to widen sparse would complain that the requested files are
outside the narrow checkout.
This changes the `hg tracked --addinclude` command to only actually update any
newly accessible files in the dirstate if they are also accessible via sparse.
Differential Revision: https://phab.mercurial-scm.org/D10734
author | Charles Chamberlain <cchamberlain@janestreet.com> |
---|---|
date | Tue, 18 May 2021 13:08:42 -0400 |
parents | ced66295ea90 |
children | 6a06155dfaef |
line wrap: on
line diff
--- a/mercurial/narrowspec.py Tue May 18 13:34:06 2021 -0400 +++ b/mercurial/narrowspec.py Tue May 18 13:08:42 2021 -0400 @@ -346,6 +346,9 @@ ds.drop(f) pctx = repo[b'.'] + + # only update added files that are in the sparse checkout + addedmatch = matchmod.intersectmatchers(addedmatch, sparse.matcher(repo)) newfiles = [f for f in pctx.manifest().walk(addedmatch) if f not in ds] for f in newfiles: ds.normallookup(f)