##// END OF EJS Templates
repository: define manifest interfaces...
repository: define manifest interfaces The long march towards declaring interfaces for repository primitives continues. This commit essentially defines interfaces based on the following types: * manifest.manifestdict -> imanifestdict * manifest.manifestlog -> imanifestlog * manifest.memmanifestctx -> imanifestrevisionwritable * manifest.manifestctx -> imanifestrevisionstored * manifest.memtreemanifestctx -> imanifestrevisionwritable * manifest.treemanifestctx -> imanifestrevisionstored * util.dirs -> idirs The interfaces are thoroughly documented. Their documentation is now better than the documentation in manifest.py in many cases. With the exception of util.dirs, classes have been annotated with their interfaces. (I didn't feel like util.dirs needed the proper interface treatment.) Tests have been added demonstrating that all classes and instances conform to their interfaces. This work was much easier than filelogs. That's because Durham did an excellent job formalizing the manifest API a while back. There are still some minor kludges with the interfaces that should probably be addressed. But the primary goal with interface declarations is getting something established. Once we have an interface, we can modify it later easily enough. Differential Revision: https://phab.mercurial-scm.org/D3869

File last commit:

r33355:9087f999 default
r38549:c82ea938 default
Show More
test-sparse-verbose-json.t
82 lines | 1.7 KiB | text/troff | Tads3Lexer
/ tests / test-sparse-verbose-json.t
Gregory Szorc
sparse: vendor Facebook-developed extension...
r33289 test sparse with --verbose and -T json
$ hg init myrepo
$ cd myrepo
$ cat > .hg/hgrc <<EOF
> [extensions]
> sparse=
> strip=
> EOF
$ echo a > show
$ echo x > hide
$ hg ci -Aqm 'initial'
$ echo b > show
$ echo y > hide
$ echo aa > show2
$ echo xx > hide2
$ hg ci -Aqm 'two'
Verify basic --include and --reset
$ hg up -q 0
Gregory Szorc
sparse: rename command to debugsparse...
r33293 $ hg debugsparse --include 'hide' -Tjson
Gregory Szorc
sparse: vendor Facebook-developed extension...
r33289 [
{
"exclude_rules_added": 0,
"files_added": 0,
"files_conflicting": 0,
"files_dropped": 1,
"include_rules_added": 1,
"profiles_added": 0
}
]
Gregory Szorc
sparse: rename command to debugsparse...
r33293 $ hg debugsparse --clear-rules
$ hg debugsparse --include 'hide' --verbose
Gregory Szorc
sparse: vendor Facebook-developed extension...
r33289 removing show
Gregory Szorc
sparse: move printing of sparse config changes function into core...
r33355 Profiles changed: 0
Include rules changed: 1
Exclude rules changed: 0
Gregory Szorc
sparse: vendor Facebook-developed extension...
r33289
Gregory Szorc
sparse: rename command to debugsparse...
r33293 $ hg debugsparse --reset -Tjson
Gregory Szorc
sparse: vendor Facebook-developed extension...
r33289 [
{
"exclude_rules_added": 0,
"files_added": 1,
"files_conflicting": 0,
"files_dropped": 0,
"include_rules_added": -1,
"profiles_added": 0
}
]
Gregory Szorc
sparse: rename command to debugsparse...
r33293 $ hg debugsparse --include 'hide'
$ hg debugsparse --reset --verbose
Gregory Szorc
sparse: vendor Facebook-developed extension...
r33289 getting show
Gregory Szorc
sparse: move printing of sparse config changes function into core...
r33355 Profiles changed: 0
Include rules changed: -1
Exclude rules changed: 0
Gregory Szorc
sparse: vendor Facebook-developed extension...
r33289
Verifying that problematic files still allow us to see the deltas when forcing:
Gregory Szorc
sparse: rename command to debugsparse...
r33293 $ hg debugsparse --include 'show*'
Gregory Szorc
sparse: vendor Facebook-developed extension...
r33289 $ touch hide
Gregory Szorc
sparse: rename command to debugsparse...
r33293 $ hg debugsparse --delete 'show*' --force -Tjson
Gregory Szorc
sparse: vendor Facebook-developed extension...
r33289 pending changes to 'hide'
[
{
"exclude_rules_added": 0,
"files_added": 0,
"files_conflicting": 1,
"files_dropped": 0,
"include_rules_added": -1,
"profiles_added": 0
}
]
Gregory Szorc
sparse: rename command to debugsparse...
r33293 $ hg debugsparse --include 'show*' --force
Gregory Szorc
sparse: vendor Facebook-developed extension...
r33289 pending changes to 'hide'
Gregory Szorc
sparse: rename command to debugsparse...
r33293 $ hg debugsparse --delete 'show*' --force --verbose
Gregory Szorc
sparse: vendor Facebook-developed extension...
r33289 pending changes to 'hide'
Gregory Szorc
sparse: move printing of sparse config changes function into core...
r33355 Profiles changed: 0
Include rules changed: -1
Exclude rules changed: 0