Mercurial > hg
view tests/test-mac-packages.t @ 40393:229d23cdb203
exchangev2: support fetching shallow files history
This commit teaches the exchangev2 client code to handle fetching shallow
files data.
Only shallow fetching of files data is supported: shallow fetching of
changeset and manifest data is explicitly not yet supported.
Previously, we would fetch file revisions for changesets that were received
by the current pull operation. In the new model, we calculate the set of
"relevant" changesets given the pull depth and only fetch files data for
those changesets.
We also teach the "filesdata" command invocation to vary parameters as needed.
The implementation here is far from complete or optimal. Subsequent pulls will
end up re-fetching a lot of files data. But the application of this data should
mostly be a no-op on the client, so it isn't a big deal.
Depending on the order file revisions are fetched in, revisions could get
inserted with the wrong revision number relationships. I think the best way
to deal with this is to remove revision numbers from storage and to either
dynamically derive them (by reconstructing a DAG from nodes/parents) or remove
revision numbers from the file storage interface completely.
A missing API that we'll likely want to write pretty soon is "ensure files
for revision(s) are present." We can kind of cajole exchangev2.pull() to do
this. But it isn't very efficient. For example, in simple cases like
widening the store to obtain data for a single revision, it is probably
more efficient to walk the manifest and find exactly which file revisions
are missing and to make explicit requests for just their data. In more
advanced cases, asking the server for all files data may be more efficient,
even though it requires sending data the client already has. There is tons
of room for future experimentation here. And TBH I'm not sure what the
final state will be.
Anyway, this commit gets us pretty close to being able to have shallow
and narrow checkouts with exchangev2/sqlite storage. Close enough that a
minimal extension should be able to provide fill in the gaps until the code
in core stabilizes and there is a user-facing way to trigger the
narrow/shallow bits from `hg clone` without also implying using of the
narrow extension...
Differential Revision: https://phab.mercurial-scm.org/D5169
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Fri, 19 Oct 2018 12:30:49 +0200 |
parents | 283a7da602ae |
children | 8d7eaff92f9c |
line wrap: on
line source
#require test-repo slow osx osxpackaging $ . "$TESTDIR/helpers-testrepo.sh" $ testrepohgenv $ OUTPUTDIR="`pwd`" $ export OUTPUTDIR $ KEEPMPKG=yes $ export KEEPMPKG $ cd "$TESTDIR"/.. $ contrib/genosxversion.py --selftest ignoredarg $ make osx > "$OUTPUTDIR/build.log" 2>&1 $ cd "$OUTPUTDIR" $ ls -d *.pkg Mercurial-*-macosx10.*.pkg (glob) $ xar -xf Mercurial*.pkg Gather list of all installed files: $ lsbom mercurial.pkg/Bom > boms.txt We've had problems with the filter logic in the past. Make sure no .DS_Store files ended up in the final package: $ grep DS_S boms.txt [1] Spot-check some randomly selected files: $ grep bdiff boms.txt | cut -d ' ' -f 1,2,3 ./Library/Python/2.7/site-packages/mercurial/cext/bdiff.so 100755 0/0 ./Library/Python/2.7/site-packages/mercurial/cffi/bdiff.py 100644 0/0 ./Library/Python/2.7/site-packages/mercurial/cffi/bdiff.pyc 100644 0/0 ./Library/Python/2.7/site-packages/mercurial/cffi/bdiff.pyo 100644 0/0 ./Library/Python/2.7/site-packages/mercurial/cffi/bdiffbuild.py 100644 0/0 ./Library/Python/2.7/site-packages/mercurial/cffi/bdiffbuild.pyc 100644 0/0 ./Library/Python/2.7/site-packages/mercurial/cffi/bdiffbuild.pyo 100644 0/0 ./Library/Python/2.7/site-packages/mercurial/pure/bdiff.py 100644 0/0 ./Library/Python/2.7/site-packages/mercurial/pure/bdiff.pyc 100644 0/0 ./Library/Python/2.7/site-packages/mercurial/pure/bdiff.pyo 100644 0/0 $ grep zsh/site-functions/_hg boms.txt | cut -d ' ' -f 1,2,3 ./usr/local/share/zsh/site-functions/_hg 100644 0/0 $ grep hg-completion.bash boms.txt | cut -d ' ' -f 1,2,3 ./usr/local/hg/contrib/hg-completion.bash 100644 0/0 $ egrep 'man[15]' boms.txt | cut -d ' ' -f 1,2,3 ./usr/local/share/man/man1 40755 0/0 ./usr/local/share/man/man1/chg.1 100644 0/0 ./usr/local/share/man/man1/hg.1 100644 0/0 ./usr/local/share/man/man5 40755 0/0 ./usr/local/share/man/man5/hgignore.5 100644 0/0 ./usr/local/share/man/man5/hgrc.5 100644 0/0 $ grep bser boms.txt | cut -d ' ' -f 1,2,3 ./Library/Python/2.7/site-packages/hgext/fsmonitor/pywatchman/bser.so 100755 0/0 ./Library/Python/2.7/site-packages/hgext/fsmonitor/pywatchman/pybser.py 100644 0/0 ./Library/Python/2.7/site-packages/hgext/fsmonitor/pywatchman/pybser.pyc 100644 0/0 ./Library/Python/2.7/site-packages/hgext/fsmonitor/pywatchman/pybser.pyo 100644 0/0 $ grep localrepo boms.txt | cut -d ' ' -f 1,2,3 ./Library/Python/2.7/site-packages/mercurial/localrepo.py 100644 0/0 ./Library/Python/2.7/site-packages/mercurial/localrepo.pyc 100644 0/0 ./Library/Python/2.7/site-packages/mercurial/localrepo.pyo 100644 0/0 $ egrep 'bin/' boms.txt | cut -d ' ' -f 1,2,3 ./usr/local/bin/chg 100755 0/0 ./usr/local/bin/hg 100755 0/0 Make sure the built binary uses the system Python interpreter $ bsdtar xf mercurial.pkg/Payload usr/local/bin Use a glob to find this to avoid check-code whining about a fixed path. $ head -n 1 usr/local/b?n/hg #!/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python Note that we're not currently installing any /etc/mercurial stuff, including merge-tool configurations.