This avoids conflict with the core extension (hgext/sparse.py). In
development mode, the hgext version takes precedence and people can easily
use the wrong sparse extension.
sparse.py is kept for compatibility.
| ryanmce |
| Restricted Project |
This avoids conflict with the core extension (hgext/sparse.py). In
development mode, the hgext version takes precedence and people can easily
use the wrong sparse extension.
sparse.py is kept for compatibility.
| Automatic diff as part of commit; lint not applicable. |
| Automatic diff as part of commit; unit tests not applicable. |
| hgext3rd/fbsparse.py | ||
|---|---|---|
| 1009 | This change seems to come from a bad pushrebase merge. It effectively reverted D1050: o 6465:ad6178 D1048 sparse: rename to fbsparse 2017-10-13 o 6462:2de524 D1050 mbthomas sparse: fix for upstreamed path conflicts changes 2017-10-13 | x 6460:9f46ad D1048 sparse: rename to fbsparse 2017-10-13 |/ o 6456:74b13c D984 remotefilelog: ignore EEXIST error of mkdir 2017-10-12 | ~ | |
| Path | Packages | |||
|---|---|---|---|---|
| P | hgext3rd/fbsparse.py (5 lines) Copied from hgext3rd/sparse.py | |||
| P | hgext3rd/sparse.py Copied to hgext3rd/fbsparse.py | |||
| M | tests/test-perftweaks.t (2 lines) | |||
| M | tests/test-remotefilelog-sparse.t (4 lines) | |||
| M | tests/test-sparse-clear.t (2 lines) | |||
| M | tests/test-sparse-clone.t (2 lines) | |||
| M | tests/test-sparse-diff.t (2 lines) | |||
| M | tests/test-sparse-extensions.t (2 lines) | |||
| M | tests/test-sparse-import.t (2 lines) | |||
| M | tests/test-sparse-merges.t (2 lines) | |||
| M | tests/test-sparse-notsparse.t (2 lines) | |||
| M | tests/test-sparse-profiles.t (4 lines) | |||
| M | tests/test-sparse-verbose-json.t (2 lines) | |||
| M | tests/test-sparse.t (4 lines) | |||
| M | tests/test-treemanifest.t (2 lines) |
| ... data = f.read() | ... data = f.read() | ||||
| >>> for record in data.strip("\0").split("\0"): | >>> for record in data.strip("\0").split("\0"): | ||||
| ... parsedrecord = json.loads(record) | ... parsedrecord = json.loads(record) | ||||
| ... print '{0}: {1}'.format(parsedrecord['category'], | ... print '{0}: {1}'.format(parsedrecord['category'], | ||||
| ... parsedrecord['data']['dirstate_size']) | ... parsedrecord['data']['dirstate_size']) | ||||
| dirstate_size: 1 | dirstate_size: 1 | ||||
| $ cat >> $HGRCPATH << EOF | $ cat >> $HGRCPATH << EOF | ||||
| > [extensions] | > [extensions] | ||||
| > sparse=$TESTDIR/../hgext3rd/sparse.py | > sparse=$TESTDIR/../hgext3rd/fbsparse.py | ||||
| > EOF | > EOF | ||||
| $ cat >> profile_base << EOF | $ cat >> profile_base << EOF | ||||
| > [include] | > [include] | ||||
| > a | > a | ||||
| > EOF | > EOF | ||||
| $ cat >> profile_extended << EOF | $ cat >> profile_extended << EOF | ||||
| > %include profile_base | > %include profile_base | ||||
| > EOF | > EOF | ||||
| $ hgcloneshallow ssh://user@dummy/master shallow --noupdate | $ hgcloneshallow ssh://user@dummy/master shallow --noupdate | ||||
| streaming all changes | streaming all changes | ||||
| 2 files to transfer, 527 bytes of data | 2 files to transfer, 527 bytes of data | ||||
| transferred 527 bytes in 0.* seconds (*/sec) (glob) | transferred 527 bytes in 0.* seconds (*/sec) (glob) | ||||
| searching for changes | searching for changes | ||||
| no changes found | no changes found | ||||
| $ cd shallow | $ cd shallow | ||||
| $ printf "[extensions]\nsparse=$TESTDIR/../hgext3rd/sparse.py\n" >> .hg/hgrc | $ printf "[extensions]\nsparse=$TESTDIR/../hgext3rd/fbsparse.py\n" >> .hg/hgrc | ||||
| $ hg sparse -I x | $ hg sparse -I x | ||||
| $ hg prefetch -r 0 | $ hg prefetch -r 0 | ||||
| 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) | ||||
| $ hg cat -r 0 x | $ hg cat -r 0 x | ||||
| x | x | ||||
| 2 files to transfer, 527 bytes of data | 2 files to transfer, 527 bytes of data | ||||
| transferred 527 bytes in 0.* seconds (*) (glob) | transferred 527 bytes in 0.* seconds (*) (glob) | ||||
| searching for changes | searching for changes | ||||
| no changes found | no changes found | ||||
| updating to branch default | updating to branch default | ||||
| 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
| 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) | ||||
| $ cd shallow2 | $ cd shallow2 | ||||
| $ printf "[extensions]\nsparse=$TESTDIR/../hgext3rd/sparse.py\n" >> .hg/hgrc | $ printf "[extensions]\nsparse=$TESTDIR/../hgext3rd/fbsparse.py\n" >> .hg/hgrc | ||||
| $ hg up -q 0 | $ hg up -q 0 | ||||
| 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob) | 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob) | ||||
| $ touch a | $ touch a | ||||
| $ hg ci -Aqm a | $ hg ci -Aqm a | ||||
| $ hg push -q -f | $ hg push -q -f | ||||
| ## Pull the unrelated commit and rebase onto it - verify unrelated file was not | ## Pull the unrelated commit and rebase onto it - verify unrelated file was not | ||||
| test sparse | test sparse | ||||
| $ hg init myrepo | $ hg init myrepo | ||||
| $ cd myrepo | $ cd myrepo | ||||
| $ cat >> $HGRCPATH <<EOF | $ cat >> $HGRCPATH <<EOF | ||||
| > [extensions] | > [extensions] | ||||
| > sparse=$TESTDIR/../hgext3rd/sparse.py | > sparse=$TESTDIR/../hgext3rd/fbsparse.py | ||||
| > purge= | > purge= | ||||
| > strip= | > strip= | ||||
| > rebase= | > rebase= | ||||
| > EOF | > EOF | ||||
| $ echo a > index.html | $ echo a > index.html | ||||
| $ echo x > data.py | $ echo x > data.py | ||||
| $ echo z > readme.txt | $ echo z > readme.txt | ||||
| test sparse | test sparse | ||||
| $ cat >> $HGRCPATH << EOF | $ cat >> $HGRCPATH << EOF | ||||
| > [ui] | > [ui] | ||||
| > ssh = python "$RUNTESTDIR/dummyssh" | > ssh = python "$RUNTESTDIR/dummyssh" | ||||
| > username = nobody <no.reply@fb.com> | > username = nobody <no.reply@fb.com> | ||||
| > [extensions] | > [extensions] | ||||
| > sparse=$TESTDIR/../hgext3rd/sparse.py | > sparse=$TESTDIR/../hgext3rd/fbsparse.py | ||||
| > purge= | > purge= | ||||
| > strip= | > strip= | ||||
| > rebase= | > rebase= | ||||
| > EOF | > EOF | ||||
| $ hg init myrepo | $ hg init myrepo | ||||
| $ cd myrepo | $ cd myrepo | ||||
| $ echo a > index.html | $ echo a > index.html | ||||
| $ hg init repo | $ hg init repo | ||||
| $ cd repo | $ cd repo | ||||
| $ cat > .hg/hgrc <<EOF | $ cat > .hg/hgrc <<EOF | ||||
| > [extensions] | > [extensions] | ||||
| > sparse=$TESTDIR/../hgext3rd/sparse.py | > sparse=$TESTDIR/../hgext3rd/fbsparse.py | ||||
| > EOF | > EOF | ||||
| $ mkdir show hide | $ mkdir show hide | ||||
| $ echo show-modify-1 > show/modify | $ echo show-modify-1 > show/modify | ||||
| $ echo show-remove-1 > show/remove | $ echo show-remove-1 > show/remove | ||||
| $ echo hide-modify-1 > hide/modify | $ echo hide-modify-1 > hide/modify | ||||
| $ echo hide-remove-1 > hide/remove | $ echo hide-remove-1 > hide/remove | ||||
| $ echo show-moveout > show/moveout | $ echo show-moveout > show/moveout | ||||
| $ echo show-movein > hide/movein | $ echo show-movein > hide/movein | ||||
| test sparse interaction with other extensions | test sparse interaction with other extensions | ||||
| $ hg init myrepo | $ hg init myrepo | ||||
| $ cd myrepo | $ cd myrepo | ||||
| $ cat > .hg/hgrc <<EOF | $ cat > .hg/hgrc <<EOF | ||||
| > [extensions] | > [extensions] | ||||
| > sparse=$TESTDIR/../hgext3rd/sparse.py | > sparse=$TESTDIR/../hgext3rd/fbsparse.py | ||||
| > strip= | > strip= | ||||
| > [simplecache] | > [simplecache] | ||||
| > cachedir=$TESTTMP/hgsimplecache | > cachedir=$TESTTMP/hgsimplecache | ||||
| > EOF | > EOF | ||||
| Test integration with simplecache for profile reads | Test integration with simplecache for profile reads | ||||
| $ $PYTHON -c 'import hgext3rd.simplecache' || exit 80 | $ $PYTHON -c 'import hgext3rd.simplecache' || exit 80 | ||||
| test sparse | test sparse | ||||
| $ hg init myrepo | $ hg init myrepo | ||||
| $ cd myrepo | $ cd myrepo | ||||
| $ cat >> $HGRCPATH <<EOF | $ cat >> $HGRCPATH <<EOF | ||||
| > [extensions] | > [extensions] | ||||
| > sparse=$TESTDIR/../hgext3rd/sparse.py | > sparse=$TESTDIR/../hgext3rd/fbsparse.py | ||||
| > purge= | > purge= | ||||
| > strip= | > strip= | ||||
| > rebase= | > rebase= | ||||
| > EOF | > EOF | ||||
| $ echo a > index.html | $ echo a > index.html | ||||
| $ echo x > data.py | $ echo x > data.py | ||||
| $ echo z > readme.txt | $ echo z > readme.txt | ||||
| test merging things outside of the sparse checkout | test merging things outside of the sparse checkout | ||||
| $ hg init myrepo | $ hg init myrepo | ||||
| $ cd myrepo | $ cd myrepo | ||||
| $ cat > .hg/hgrc <<EOF | $ cat > .hg/hgrc <<EOF | ||||
| > [extensions] | > [extensions] | ||||
| > sparse=$TESTDIR/../hgext3rd/sparse.py | > sparse=$TESTDIR/../hgext3rd/fbsparse.py | ||||
| > EOF | > EOF | ||||
| $ echo foo > foo | $ echo foo > foo | ||||
| $ echo bar > bar | $ echo bar > bar | ||||
| $ hg add foo bar | $ hg add foo bar | ||||
| $ hg commit -m initial | $ hg commit -m initial | ||||
| $ hg branch feature | $ hg branch feature | ||||
| Make sure the sparse extension does not break functionality when it gets | Make sure the sparse extension does not break functionality when it gets | ||||
| loaded in a non-sparse repository. | loaded in a non-sparse repository. | ||||
| First create a base repository with sparse enabled. | First create a base repository with sparse enabled. | ||||
| $ hg init base | $ hg init base | ||||
| $ cd base | $ cd base | ||||
| $ cat > .hg/hgrc <<EOF | $ cat > .hg/hgrc <<EOF | ||||
| > [extensions] | > [extensions] | ||||
| > sparse=$TESTDIR/../hgext3rd/sparse.py | > sparse=$TESTDIR/../hgext3rd/fbsparse.py | ||||
| > journal= | > journal= | ||||
| > EOF | > EOF | ||||
| $ echo a > file1 | $ echo a > file1 | ||||
| $ echo x > file2 | $ echo x > file2 | ||||
| $ hg ci -Aqm 'initial' | $ hg ci -Aqm 'initial' | ||||
| $ cd .. | $ cd .. | ||||
| test sparse | test sparse | ||||
| $ hg init myrepo | $ hg init myrepo | ||||
| $ cd myrepo | $ cd myrepo | ||||
| $ cat > .hg/hgrc <<EOF | $ cat > .hg/hgrc <<EOF | ||||
| > [extensions] | > [extensions] | ||||
| > sparse=$TESTDIR/../hgext3rd/sparse.py | > sparse=$TESTDIR/../hgext3rd/fbsparse.py | ||||
| > purge= | > purge= | ||||
| > strip= | > strip= | ||||
| > rebase= | > rebase= | ||||
| > EOF | > EOF | ||||
| $ echo a > index.html | $ echo a > index.html | ||||
| $ echo x > data.py | $ echo x > data.py | ||||
| $ echo z > readme.txt | $ echo z > readme.txt | ||||
| $ cd .. | $ cd .. | ||||
| Test file permissions changing across a sparse profile change | Test file permissions changing across a sparse profile change | ||||
| $ hg init sparseperm | $ hg init sparseperm | ||||
| $ cd sparseperm | $ cd sparseperm | ||||
| $ cat > .hg/hgrc <<EOF | $ cat > .hg/hgrc <<EOF | ||||
| > [extensions] | > [extensions] | ||||
| > sparse=$TESTDIR/../hgext3rd/sparse.py | > sparse=$TESTDIR/../hgext3rd/fbsparse.py | ||||
| > EOF | > EOF | ||||
| $ touch a b | $ touch a b | ||||
| $ cat > .hgsparse <<EOF | $ cat > .hgsparse <<EOF | ||||
| > a | > a | ||||
| > EOF | > EOF | ||||
| $ hg commit -Aqm 'initial' | $ hg commit -Aqm 'initial' | ||||
| $ chmod a+x b | $ chmod a+x b | ||||
| $ hg commit -qm 'make executable' | $ hg commit -qm 'make executable' | ||||
| test sparse with --verbose and -T json | test sparse with --verbose and -T json | ||||
| $ hg init myrepo | $ hg init myrepo | ||||
| $ cd myrepo | $ cd myrepo | ||||
| $ cat > .hg/hgrc <<EOF | $ cat > .hg/hgrc <<EOF | ||||
| > [extensions] | > [extensions] | ||||
| > sparse=$TESTDIR/../hgext3rd/sparse.py | > sparse=$TESTDIR/../hgext3rd/fbsparse.py | ||||
| > strip= | > strip= | ||||
| > EOF | > EOF | ||||
| $ echo a > show | $ echo a > show | ||||
| $ echo x > hide | $ echo x > hide | ||||
| $ hg ci -Aqm 'initial' | $ hg ci -Aqm 'initial' | ||||
| $ echo b > show | $ echo b > show | ||||
| test sparse | test sparse | ||||
| $ hg init myrepo | $ hg init myrepo | ||||
| $ cd myrepo | $ cd myrepo | ||||
| $ cat > .hg/hgrc <<EOF | $ cat > .hg/hgrc <<EOF | ||||
| > [extensions] | > [extensions] | ||||
| > sparse=$TESTDIR/../hgext3rd/sparse.py | > sparse=$TESTDIR/../hgext3rd/fbsparse.py | ||||
| > strip= | > strip= | ||||
| > EOF | > EOF | ||||
| $ echo a > show | $ echo a > show | ||||
| $ echo x > hide | $ echo x > hide | ||||
| $ hg ci -Aqm 'initial' | $ hg ci -Aqm 'initial' | ||||
| $ echo b > show | $ echo b > show | ||||
| $ cd .. | $ cd .. | ||||
| Test non-sparse repos work while sparse is loaded | Test non-sparse repos work while sparse is loaded | ||||
| $ hg init sparserepo | $ hg init sparserepo | ||||
| $ hg init nonsparserepo | $ hg init nonsparserepo | ||||
| $ cd sparserepo | $ cd sparserepo | ||||
| $ cat > .hg/hgrc <<EOF | $ cat > .hg/hgrc <<EOF | ||||
| > [extensions] | > [extensions] | ||||
| > sparse=$TESTDIR/../hgext3rd/sparse.py | > sparse=$TESTDIR/../hgext3rd/fbsparse.py | ||||
| > EOF | > EOF | ||||
| $ cd ../nonsparserepo | $ cd ../nonsparserepo | ||||
| $ echo x > x && hg add x && hg commit -qAm x | $ echo x > x && hg add x && hg commit -qAm x | ||||
| $ cd ../sparserepo | $ cd ../sparserepo | ||||
| $ hg clone ../nonsparserepo ../nonsparserepo2 | $ hg clone ../nonsparserepo ../nonsparserepo2 | ||||
| updating to branch default | updating to branch default | ||||
| 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
| Node Delta Base Delta Length | Node Delta Base Delta Length | ||||
| 8289b85c6a30 000000000000 92 | 8289b85c6a30 000000000000 92 | ||||
| Test treemanifest with sparse enabled | Test treemanifest with sparse enabled | ||||
| $ cat >> .hg/hgrc <<EOF | $ cat >> .hg/hgrc <<EOF | ||||
| > [extensions] | > [extensions] | ||||
| > sparse = $TESTDIR/../hgext3rd/sparse.py | > sparse = $TESTDIR/../hgext3rd/fbsparse.py | ||||
| > reset = $TESTDIR/../hgext3rd/reset.py | > reset = $TESTDIR/../hgext3rd/reset.py | ||||
| > EOF | > EOF | ||||
| $ hg sparse -I subdir | $ hg sparse -I subdir | ||||
| $ hg reset '.^' | $ hg reset '.^' | ||||
| resetting without an active bookmark | resetting without an active bookmark | ||||
| saved backup bundle to $TESTTMP/client/.hg/strip-backup/27a577922312-3ad85b1a-backup.hg (glob) | saved backup bundle to $TESTTMP/client/.hg/strip-backup/27a577922312-3ad85b1a-backup.hg (glob) | ||||
| $ hg status | $ hg status | ||||
| M subdir/y | M subdir/y | ||||
This change seems to come from a bad pushrebase merge. It effectively reverted D1050: