2019-12-10 02:24:31 +03:00
|
|
|
#chg-compatible
|
|
|
|
|
2020-01-20 13:42:49 +03:00
|
|
|
$ disable treemanifest
|
2014-12-01 22:02:08 +03:00
|
|
|
test sparse
|
|
|
|
|
2019-02-25 14:50:46 +03:00
|
|
|
$ enable sparse
|
2014-12-01 22:02:08 +03:00
|
|
|
$ hg init myrepo
|
|
|
|
$ cd myrepo
|
|
|
|
|
|
|
|
$ 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'
|
|
|
|
|
2018-10-19 16:49:05 +03:00
|
|
|
Verify basic include
|
2014-12-01 22:02:08 +03:00
|
|
|
|
|
|
|
$ hg up -q 0
|
2018-10-19 16:49:05 +03:00
|
|
|
$ hg sparse include 'hide'
|
2014-12-01 22:02:08 +03:00
|
|
|
$ ls
|
|
|
|
hide
|
|
|
|
|
2015-11-26 01:06:33 +03:00
|
|
|
Absolute paths outside the repo should just be rejected
|
|
|
|
|
2018-10-19 16:49:05 +03:00
|
|
|
$ hg sparse include /foo/bar
|
2017-07-28 16:23:52 +03:00
|
|
|
abort: paths cannot be absolute
|
2017-07-24 12:12:37 +03:00
|
|
|
[255]
|
2018-10-19 16:49:05 +03:00
|
|
|
$ hg sparse include '$TESTTMP/myrepo/hide'
|
2015-11-26 01:06:33 +03:00
|
|
|
|
2018-10-19 16:49:05 +03:00
|
|
|
$ hg sparse include '/root'
|
2017-07-28 16:23:52 +03:00
|
|
|
abort: paths cannot be absolute
|
2017-07-24 12:12:37 +03:00
|
|
|
[255]
|
2015-12-02 00:17:31 +03:00
|
|
|
|
2017-07-25 20:43:55 +03:00
|
|
|
Repo root-relaive vs. cwd-relative includes
|
|
|
|
$ mkdir subdir
|
|
|
|
$ cd subdir
|
2018-10-19 16:49:05 +03:00
|
|
|
$ hg sparse include --config sparse.includereporootpaths=on notinsubdir/path
|
|
|
|
$ hg sparse include --config sparse.includereporootpaths=off **/path
|
|
|
|
$ hg sparse include --config sparse.includereporootpaths=off path:abspath
|
2017-07-25 20:43:55 +03:00
|
|
|
$ hg sparse
|
|
|
|
[include]
|
|
|
|
$TESTTMP/myrepo/hide
|
|
|
|
hide
|
2017-08-04 16:16:45 +03:00
|
|
|
notinsubdir/path
|
|
|
|
path:abspath
|
|
|
|
subdir/**/path
|
2017-07-25 20:43:55 +03:00
|
|
|
[exclude]
|
|
|
|
|
|
|
|
|
2017-07-30 18:42:40 +03:00
|
|
|
$ cd ..
|
|
|
|
$ rm -rf subdir
|
|
|
|
|
|
|
|
Verify deleting uses relative paths
|
|
|
|
$ mkdir subdir && echo foo > subdir/foo
|
|
|
|
$ hg sparse
|
|
|
|
[include]
|
|
|
|
$TESTTMP/myrepo/hide
|
|
|
|
hide
|
2017-08-04 16:16:45 +03:00
|
|
|
notinsubdir/path
|
|
|
|
path:abspath
|
|
|
|
subdir/**/path
|
2017-07-30 18:42:40 +03:00
|
|
|
[exclude]
|
|
|
|
|
|
|
|
|
|
|
|
$ cd subdir
|
2017-08-04 16:16:45 +03:00
|
|
|
$ hg sparse --delete **/path
|
2017-07-30 18:42:40 +03:00
|
|
|
$ hg sparse
|
|
|
|
[include]
|
|
|
|
$TESTTMP/myrepo/hide
|
|
|
|
hide
|
2017-08-04 16:16:45 +03:00
|
|
|
notinsubdir/path
|
|
|
|
path:abspath
|
2017-07-30 18:42:40 +03:00
|
|
|
[exclude]
|
|
|
|
|
|
|
|
|
2017-07-25 20:43:55 +03:00
|
|
|
$ cd ..
|
|
|
|
$ rm -rf subdir
|
|
|
|
|
2014-12-01 22:02:08 +03:00
|
|
|
Verify commiting while sparse includes other files
|
|
|
|
|
|
|
|
$ echo z > hide
|
|
|
|
$ hg ci -Aqm 'edit hide'
|
|
|
|
$ ls
|
|
|
|
hide
|
|
|
|
$ hg manifest
|
|
|
|
hide
|
|
|
|
show
|
2019-11-01 23:29:32 +03:00
|
|
|
$ hg files
|
|
|
|
hide
|
2014-12-01 22:02:08 +03:00
|
|
|
|
|
|
|
Verify --reset brings files back
|
|
|
|
|
|
|
|
$ hg sparse --reset
|
|
|
|
$ ls
|
|
|
|
hide
|
|
|
|
show
|
|
|
|
$ cat hide
|
|
|
|
z
|
|
|
|
$ cat show
|
|
|
|
a
|
|
|
|
|
|
|
|
Verify 'hg sparse' default output
|
|
|
|
|
|
|
|
$ hg up -q null
|
2018-10-19 16:49:05 +03:00
|
|
|
$ hg sparse include 'show*'
|
2014-12-01 22:02:08 +03:00
|
|
|
|
|
|
|
$ hg sparse
|
|
|
|
[include]
|
|
|
|
show*
|
|
|
|
[exclude]
|
|
|
|
|
|
|
|
|
|
|
|
Verify update only writes included files
|
|
|
|
|
|
|
|
$ hg up -q 0
|
|
|
|
$ ls
|
|
|
|
show
|
|
|
|
|
|
|
|
$ hg up -q 1
|
|
|
|
$ ls
|
|
|
|
show
|
|
|
|
show2
|
|
|
|
|
|
|
|
Verify status only shows included files
|
|
|
|
|
|
|
|
$ touch hide
|
|
|
|
$ touch hide3
|
|
|
|
$ echo c > show
|
|
|
|
$ hg status
|
|
|
|
M show
|
|
|
|
|
|
|
|
Adding an excluded file should fail
|
|
|
|
|
|
|
|
$ hg add hide3
|
|
|
|
abort: cannot add 'hide3' - it is outside the sparse checkout
|
2018-04-18 20:31:28 +03:00
|
|
|
(include file with `hg sparse include <pattern>` or use `hg add -s <file>` to include file directory while adding)
|
2014-12-01 22:02:08 +03:00
|
|
|
[255]
|
|
|
|
|
|
|
|
Verify deleting sparseness while a file has changes fails
|
|
|
|
|
2018-10-19 16:49:05 +03:00
|
|
|
$ hg sparse uninclude 'show*'
|
2014-12-01 22:02:08 +03:00
|
|
|
pending changes to 'hide'
|
|
|
|
abort: cannot change sparseness due to pending changes (delete the files or use --force to bring them back dirty)
|
|
|
|
[255]
|
|
|
|
|
|
|
|
Verify deleting sparseness with --force brings back files
|
|
|
|
|
2018-10-19 16:49:05 +03:00
|
|
|
$ hg sparse uninclude -f 'show*'
|
2014-12-01 22:02:08 +03:00
|
|
|
pending changes to 'hide'
|
|
|
|
$ ls
|
|
|
|
hide
|
|
|
|
hide2
|
|
|
|
hide3
|
|
|
|
show
|
|
|
|
show2
|
|
|
|
$ hg st
|
|
|
|
M hide
|
|
|
|
M show
|
|
|
|
? hide3
|
|
|
|
|
2016-04-04 22:48:01 +03:00
|
|
|
Verify editing sparseness fails if pending changes
|
2014-12-01 22:02:08 +03:00
|
|
|
|
2018-10-19 16:49:05 +03:00
|
|
|
$ hg sparse include 'show*'
|
2014-12-01 22:02:08 +03:00
|
|
|
pending changes to 'hide'
|
|
|
|
abort: could not update sparseness due to pending changes
|
|
|
|
[255]
|
|
|
|
|
|
|
|
Verify adding sparseness hides files
|
|
|
|
|
2018-10-19 16:49:05 +03:00
|
|
|
$ hg sparse exclude -f 'hide*'
|
2014-12-01 22:02:08 +03:00
|
|
|
pending changes to 'hide'
|
|
|
|
$ ls
|
|
|
|
hide
|
|
|
|
hide3
|
|
|
|
show
|
|
|
|
show2
|
|
|
|
$ hg st
|
|
|
|
M show
|
|
|
|
|
|
|
|
$ hg up -qC .
|
2020-01-22 07:45:48 +03:00
|
|
|
$ hg purge --all
|
2014-12-01 22:02:08 +03:00
|
|
|
$ ls
|
|
|
|
show
|
|
|
|
show2
|
|
|
|
|
2015-04-10 03:17:03 +03:00
|
|
|
Verify rebase temporarily includes excluded files
|
2014-12-01 22:02:08 +03:00
|
|
|
|
|
|
|
$ hg rebase -d 1 -r 2 --config extensions.rebase=
|
2019-12-18 00:45:17 +03:00
|
|
|
rebasing b91df4f39e75 "edit hide"
|
2015-04-10 03:17:03 +03:00
|
|
|
temporarily included 1 file(s) in the sparse checkout for merging
|
|
|
|
merging hide
|
2018-10-22 22:45:46 +03:00
|
|
|
warning: 1 conflicts while merging hide! (edit, then use 'hg resolve --mark')
|
2015-04-10 03:17:03 +03:00
|
|
|
unresolved conflicts (see hg resolve, then hg rebase --continue)
|
|
|
|
[1]
|
|
|
|
|
|
|
|
$ hg sparse
|
|
|
|
[include]
|
|
|
|
|
|
|
|
[exclude]
|
|
|
|
hide*
|
|
|
|
|
|
|
|
Temporarily Included Files (for merge/rebase):
|
|
|
|
hide
|
|
|
|
|
|
|
|
$ cat hide
|
2016-11-29 18:23:32 +03:00
|
|
|
<<<<<<< dest: 39278f7c08a9 - test: two
|
2015-04-10 03:17:03 +03:00
|
|
|
y
|
|
|
|
=======
|
|
|
|
z
|
|
|
|
>>>>>>> source: b91df4f39e75 - test: edit hide
|
|
|
|
|
|
|
|
Verify aborting a rebase cleans up temporary files
|
2014-12-01 22:02:08 +03:00
|
|
|
|
|
|
|
$ hg rebase --abort --config extensions.rebase=
|
2015-04-10 03:17:03 +03:00
|
|
|
cleaned up 1 temporarily added file(s) from the sparse checkout
|
2014-12-01 22:02:08 +03:00
|
|
|
rebase aborted
|
2015-04-10 03:17:03 +03:00
|
|
|
$ rm hide.orig
|
|
|
|
|
|
|
|
$ ls
|
|
|
|
show
|
|
|
|
show2
|
2014-12-01 22:02:08 +03:00
|
|
|
|
|
|
|
Verify merge fails if merging excluded files
|
|
|
|
|
|
|
|
$ hg up -q 1
|
|
|
|
$ hg merge -r 2
|
2015-04-10 03:17:03 +03:00
|
|
|
temporarily included 1 file(s) in the sparse checkout for merging
|
|
|
|
merging hide
|
2018-10-22 22:45:46 +03:00
|
|
|
warning: 1 conflicts while merging hide! (edit, then use 'hg resolve --mark')
|
2015-04-10 03:17:03 +03:00
|
|
|
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
|
|
|
|
use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
|
|
|
|
[1]
|
|
|
|
$ hg sparse
|
|
|
|
[include]
|
|
|
|
|
|
|
|
[exclude]
|
|
|
|
hide*
|
|
|
|
|
|
|
|
Temporarily Included Files (for merge/rebase):
|
|
|
|
hide
|
|
|
|
|
|
|
|
$ hg up -C .
|
|
|
|
cleaned up 1 temporarily added file(s) from the sparse checkout
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ hg sparse
|
|
|
|
[include]
|
|
|
|
|
|
|
|
[exclude]
|
|
|
|
hide*
|
|
|
|
|
2014-12-16 22:35:41 +03:00
|
|
|
|
|
|
|
Verify strip -k resets dirstate correctly
|
|
|
|
|
|
|
|
$ hg status
|
|
|
|
$ hg sparse
|
|
|
|
[include]
|
|
|
|
|
|
|
|
[exclude]
|
|
|
|
hide*
|
|
|
|
|
|
|
|
$ hg log -r . -T '{rev}\n' --stat
|
|
|
|
1
|
|
|
|
hide | 2 +-
|
|
|
|
hide2 | 1 +
|
|
|
|
show | 2 +-
|
|
|
|
show2 | 1 +
|
|
|
|
4 files changed, 4 insertions(+), 2 deletions(-)
|
|
|
|
|
2019-02-25 14:50:46 +03:00
|
|
|
$ hg debugstrip -r . -k
|
hgext: fix many tests, run-tests, writecg2 for hg3.3
Summary: Still need to fix pushrebase
Test Plan: ##run-tests.py##
Reviewers: sid0, daviser, davidsp, mitrandir, akushner, rmcelroy, pyd, mpm, durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D1813630
Signature: t1:1813630:1422573745:c5ea2a8acdfda0e555d1ae56a16f4fb5e5618174
2015-01-30 02:06:06 +03:00
|
|
|
saved backup bundle to $TESTTMP/myrepo/.hg/strip-backup/39278f7c08a9-ce59e002-backup.hg (glob)
|
2014-12-16 22:35:41 +03:00
|
|
|
$ hg status
|
|
|
|
M show
|
|
|
|
? show2
|
2015-01-15 03:31:01 +03:00
|
|
|
|
|
|
|
Verify rebase succeeds if all changed files are in sparse checkout
|
|
|
|
|
|
|
|
$ hg commit -Aqm "add show2"
|
|
|
|
$ hg rebase -d 1 --config extensions.rebase=
|
2019-12-18 00:45:17 +03:00
|
|
|
rebasing bdde55290160 "add show2"
|
2015-04-17 20:01:55 +03:00
|
|
|
|
|
|
|
Verify log --sparse only shows commits that affect the sparse checkout
|
|
|
|
|
|
|
|
$ hg log -T '{rev} '
|
2018-10-27 04:52:14 +03:00
|
|
|
3 1 0 (no-eol)
|
2015-04-17 20:01:55 +03:00
|
|
|
$ hg log --sparse -T '{rev} '
|
2018-10-27 04:52:14 +03:00
|
|
|
3 0 (no-eol)
|
2015-04-24 19:52:00 +03:00
|
|
|
|
|
|
|
Test status on a file in a subdir
|
|
|
|
|
|
|
|
$ mkdir -p dir1/dir2
|
|
|
|
$ touch dir1/dir2/file
|
|
|
|
$ hg sparse -I dir1/dir2
|
|
|
|
$ hg status
|
|
|
|
? dir1/dir2/file
|
2015-04-24 22:29:31 +03:00
|
|
|
|
2015-04-18 00:29:23 +03:00
|
|
|
Test that add -s adds dirs to sparse profile
|
|
|
|
|
|
|
|
$ hg sparse --reset
|
2018-10-19 16:49:05 +03:00
|
|
|
$ hg sparse include empty
|
2015-04-18 00:29:23 +03:00
|
|
|
$ hg sparse
|
|
|
|
[include]
|
|
|
|
empty
|
|
|
|
[exclude]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$ mkdir add
|
|
|
|
$ touch add/foo
|
|
|
|
$ touch add/bar
|
|
|
|
$ hg add add/foo
|
|
|
|
abort: cannot add 'add/foo' - it is outside the sparse checkout
|
2018-04-18 20:31:28 +03:00
|
|
|
(include file with `hg sparse include <pattern>` or use `hg add -s <file>` to include file directory while adding)
|
2015-04-18 00:29:23 +03:00
|
|
|
[255]
|
|
|
|
$ hg add -s add/foo
|
|
|
|
$ hg st
|
|
|
|
A add/foo
|
|
|
|
? add/bar
|
|
|
|
$ hg sparse
|
|
|
|
[include]
|
|
|
|
add
|
2015-04-18 00:32:04 +03:00
|
|
|
empty
|
2015-04-18 00:29:23 +03:00
|
|
|
[exclude]
|
|
|
|
|
|
|
|
|
|
|
|
$ hg add -s add/*
|
|
|
|
add/foo already tracked!
|
|
|
|
$ hg st
|
|
|
|
A add/bar
|
|
|
|
A add/foo
|
|
|
|
$ hg sparse
|
|
|
|
[include]
|
|
|
|
add
|
2015-04-18 00:32:04 +03:00
|
|
|
empty
|
2015-04-18 00:29:23 +03:00
|
|
|
[exclude]
|
|
|
|
|
|
|
|
|
2017-10-01 15:45:27 +03:00
|
|
|
Test --cwd-list
|
|
|
|
$ hg commit -m 'commit'
|
|
|
|
$ hg sparse --cwd-list
|
|
|
|
add
|
|
|
|
- hide
|
|
|
|
- show
|
|
|
|
- show2
|
|
|
|
$ cd add
|
|
|
|
$ hg sparse --cwd-list
|
|
|
|
bar
|
|
|
|
foo
|
2018-10-19 16:49:05 +03:00
|
|
|
$ hg sparse include foo
|
|
|
|
$ hg sparse uninclude .
|
|
|
|
$ hg sparse show
|
|
|
|
Additional Included Paths:
|
|
|
|
|
|
|
|
add/foo
|
|
|
|
empty
|
2017-10-01 15:45:27 +03:00
|
|
|
$ hg sparse --cwd-list
|
|
|
|
- bar
|
|
|
|
foo
|
2018-02-27 22:13:59 +03:00
|
|
|
|
|
|
|
Make sure to match whole directory names, not prefixes
|
|
|
|
|
|
|
|
$ mkdir prefix prefixpostfix
|
|
|
|
$ touch prefix/correct prefixpostfix/incorrect
|
|
|
|
$ hg sparse -I prefix prefixpostfix
|
|
|
|
$ hg addremove .
|
|
|
|
adding prefix/correct
|
|
|
|
adding prefixpostfix/incorrect
|
|
|
|
$ hg ci -m 'subdirs'
|
|
|
|
$ cd prefix
|
|
|
|
$ hg sparse --cwd-list
|
|
|
|
correct
|
|
|
|
$ cd ../..
|
2015-06-05 02:50:18 +03:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
Test non-sparse repos work while sparse is loaded
|
|
|
|
$ hg init sparserepo
|
|
|
|
$ hg init nonsparserepo
|
|
|
|
$ cd sparserepo
|
|
|
|
$ cat > .hg/hgrc <<EOF
|
|
|
|
> [extensions]
|
2018-11-30 13:17:29 +03:00
|
|
|
> sparse=
|
2015-06-05 02:50:18 +03:00
|
|
|
> EOF
|
2015-07-24 23:03:09 +03:00
|
|
|
$ cd ../nonsparserepo
|
|
|
|
$ echo x > x && hg add x && hg commit -qAm x
|
|
|
|
$ cd ../sparserepo
|
2015-06-05 02:50:18 +03:00
|
|
|
$ hg clone ../nonsparserepo ../nonsparserepo2
|
|
|
|
updating to branch default
|
2015-07-24 23:03:09 +03:00
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
2015-12-08 03:57:17 +03:00
|
|
|
|
|
|
|
Test debugrebuilddirstate
|
|
|
|
$ cd ../sparserepo
|
|
|
|
$ touch included
|
|
|
|
$ touch excluded
|
|
|
|
$ hg add included excluded
|
|
|
|
$ hg commit -m 'a commit' -q
|
|
|
|
$ cp .hg/dirstate ../dirstateboth
|
|
|
|
$ hg sparse -X excluded
|
|
|
|
$ cp ../dirstateboth .hg/dirstate
|
|
|
|
$ hg debugrebuilddirstate
|
|
|
|
$ hg debugdirstate
|
2016-10-04 15:25:28 +03:00
|
|
|
n 0 -1 unset included
|
2015-12-08 03:57:17 +03:00
|
|
|
|
|
|
|
Test debugdirstate --minimal where file is in the parent manifest but not the
|
|
|
|
dirstate
|
|
|
|
$ hg sparse -X included
|
|
|
|
$ hg debugdirstate
|
|
|
|
$ cp .hg/dirstate ../dirstateallexcluded
|
|
|
|
$ hg sparse --reset
|
|
|
|
$ hg sparse -X excluded
|
|
|
|
$ cp ../dirstateallexcluded .hg/dirstate
|
|
|
|
$ touch includedadded
|
|
|
|
$ hg add includedadded
|
|
|
|
$ hg debugdirstate --nodates
|
|
|
|
a 0 -1 unset includedadded
|
|
|
|
$ hg debugrebuilddirstate --minimal
|
|
|
|
$ hg debugdirstate --nodates
|
2016-10-04 15:25:28 +03:00
|
|
|
n 0 -1 unset included
|
2015-12-08 03:57:17 +03:00
|
|
|
a 0 -1 * includedadded (glob)
|
|
|
|
|
|
|
|
Test debugdirstate --minimal where a file is not in parent manifest
|
|
|
|
but in the dirstate. This should take into account excluded files in the
|
|
|
|
manifest
|
|
|
|
$ cp ../dirstateboth .hg/dirstate
|
|
|
|
$ touch includedadded
|
|
|
|
$ hg add includedadded
|
|
|
|
$ touch excludednomanifest
|
|
|
|
$ hg add excludednomanifest
|
|
|
|
$ cp .hg/dirstate ../moreexcluded
|
|
|
|
$ hg forget excludednomanifest
|
|
|
|
$ rm excludednomanifest
|
|
|
|
$ hg sparse -X excludednomanifest
|
|
|
|
$ cp ../moreexcluded .hg/dirstate
|
|
|
|
$ hg manifest
|
|
|
|
excluded
|
|
|
|
included
|
|
|
|
We have files in the dirstate that are included and excluded. Some are in the
|
|
|
|
manifest and some are not.
|
|
|
|
$ hg debugdirstate --nodates
|
|
|
|
n 644 0 * excluded (glob)
|
|
|
|
a 0 -1 * excludednomanifest (glob)
|
|
|
|
n 644 0 * included (glob)
|
|
|
|
a 0 -1 * includedadded (glob)
|
|
|
|
$ hg debugrebuilddirstate --minimal
|
|
|
|
$ hg debugdirstate --nodates
|
|
|
|
n 644 0 * included (glob)
|
|
|
|
a 0 -1 * includedadded (glob)
|
|
|
|
|
2018-10-17 00:19:25 +03:00
|
|
|
Test logging the dirsize and sparse profiles
|
|
|
|
|
|
|
|
Set up the sampling extension and set a log file, then do a repo status.
|
|
|
|
We need to disable the SCM_SAMPLING_FILEPATH env var because arcanist may set it!
|
|
|
|
|
|
|
|
$ touch a && hg add a
|
|
|
|
$ unset SCM_SAMPLING_FILEPATH
|
|
|
|
$ hg ci -m "add some new files"
|
|
|
|
$ LOGDIR=`pwd`/logs
|
|
|
|
$ mkdir $LOGDIR
|
|
|
|
$ cat >> $HGRCPATH << EOF
|
|
|
|
> [sampling]
|
|
|
|
> key.dirstate_size=dirstate_size
|
|
|
|
> key.sparse_profiles=sparse_profiles
|
|
|
|
> filepath = $LOGDIR/samplingpath.txt
|
|
|
|
> [extensions]
|
|
|
|
> sampling=
|
|
|
|
> EOF
|
|
|
|
$ rm -f $LOGDIR/samplingpath.txt
|
|
|
|
$ hg status
|
|
|
|
>>> import json
|
|
|
|
>>> with open("$LOGDIR/samplingpath.txt") as f:
|
|
|
|
... data = f.read()
|
|
|
|
>>> for record in data.strip("\0").split("\0"):
|
|
|
|
... parsedrecord = json.loads(record)
|
|
|
|
... if parsedrecord['category'] == 'dirstate_size':
|
|
|
|
... print('{0}: {1}'.format(parsedrecord['category'],
|
|
|
|
... parsedrecord['data']['dirstate_size']))
|
|
|
|
dirstate_size: 3
|
|
|
|
$ cat >> profile_base << EOF
|
|
|
|
> [include]
|
|
|
|
> a
|
|
|
|
> EOF
|
|
|
|
$ cat >> profile_extended << EOF
|
|
|
|
> %include profile_base
|
|
|
|
> EOF
|
|
|
|
$ cat >> $HGRCPATH << EOF
|
|
|
|
> [sparse]
|
|
|
|
> largecheckouthint=True
|
|
|
|
> largecheckoutcount=1
|
|
|
|
> EOF
|
|
|
|
$ hg add profile_base profile_extended
|
|
|
|
hint[sparse-largecheckout]: Your repository checkout has * files which makes Many mercurial commands slower. Learn how to make it smaller at https://fburl.com/hgsparse (glob)
|
|
|
|
hint[hint-ack]: use 'hg hint --ack sparse-largecheckout' to silence these hints
|
|
|
|
$ hg ci -m 'adding sparse profiles'
|
|
|
|
hint[sparse-largecheckout]: Your repository checkout has * files which makes Many mercurial commands slower. Learn how to make it smaller at https://fburl.com/hgsparse (glob)
|
|
|
|
hint[hint-ack]: use 'hg hint --ack sparse-largecheckout' to silence these hints
|
|
|
|
$ rm -f $LOGDIR/samplingpath.txt
|
|
|
|
$ hg sparse --enable-profile profile_extended
|
|
|
|
hint[sparse-largecheckout]: Your repository checkout has * files which makes Many mercurial commands slower. Learn how to make it smaller at https://fburl.com/hgsparse (glob)
|
|
|
|
hint[hint-ack]: use 'hg hint --ack sparse-largecheckout' to silence these hints
|
|
|
|
>>> import json
|
|
|
|
>>> with open("$LOGDIR/samplingpath.txt") as f:
|
|
|
|
... data = f.read()
|
|
|
|
>>> for record in data.strip("\0").split("\0"):
|
|
|
|
... parsedrecord = json.loads(record)
|
|
|
|
... if parsedrecord['category'] == 'sparse_profiles':
|
|
|
|
... print('active_profiles:', parsedrecord['data']['active_profiles'])
|
2020-01-23 00:39:37 +03:00
|
|
|
active_profiles: %include profile_extended
|
|
|
|
[include]
|
|
|
|
|
|
|
|
[exclude]
|
|
|
|
excluded
|
|
|
|
excludednomanifest
|
|
|
|
|