sparse: use relglob to exclude readme files

Summary: Although the old glob *should* work, in practice the treemanifest matcher seems to have issues with glob:**/ paths, where relglob: works.

Reviewed By: ryanmce

Differential Revision: D7287992

fbshipit-source-id: d3802e730d937eeca7059dac691d8dac5a5de262
This commit is contained in:
Martijn Pieters 2018-03-20 08:22:48 -07:00 committed by Saurabh Singh
parent df8173b17b
commit efd45069e3
2 changed files with 13 additions and 1 deletions

View File

@ -814,7 +814,7 @@ def _discover(ui, repo):
matcher = matchmod.match(
repo.root, repo.getcwd(),
patterns=['path:' + profile_directory],
exclude=['**/README.*', '**/README'])
exclude=['relglob:README.*', 'relglob:README'])
available.update(mf.matches(matcher))
# sort profiles and read profile metadata as we iterate

View File

@ -376,6 +376,18 @@ Test profile discovery
}
]
The current working directory plays no role in listing profiles:
$ mkdir otherdir
$ cd otherdir
$ hg sparse --list-profiles
symbols: * = active profile, ~ = transitively included
~ profiles/bar/eggs - Base profile including the profiles directory
profiles/bar/python
profiles/foo/monty
* profiles/foo/spam - Profile that only includes another
$ cd ..
Profiles are loaded from the manifest, so excluding a profile directory should
not hamper listing.