Mercurial > hg
view tests/test-narrow-archive.t @ 37485:0b7475ea38cf
wireproto: port heads command to wire protocol v2
After much thought and consideration, wire protocol version 2's
commands will be defined in different functions from the existing
commands. This will make it easier to implement these commands
because it won't require shoehorning things like response formatting
and argument declaration into the same APIs.
For example, wire protocol version 1 requires that commands declare
a fixed and ordered list of argument names. It isn't really possible
to insert new arguments or have optional arguments without
breaking backwards compatibility. Wire protocol version 2, however,
uses CBOR maps for passing arguments. So arguments a) can be
optional b) can be added without BC c) can be strongly typed.
This commit starts our trek towards reimplementing the wire protocol
for version 2 with the heads command. It is pretty similar to the
existing heads command. One added feature is it can be told to
operate on only public phase changesets. This is useful for
making discovery faster when a repo has tens of thousands of
draft phase heads (such as Mozilla's "try" repository).
The HTTPv2 server-side protocol has had its `getargs()` implementation
updated to reflect that arguments are a map and not a list.
Differential Revision: https://phab.mercurial-scm.org/D3179
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 28 Mar 2018 14:55:13 -0700 |
parents | a2a6e724d61a |
children |
line wrap: on
line source
Make a narrow clone then archive it $ . "$TESTDIR/narrow-library.sh" $ hg init master $ cd master $ for x in `$TESTDIR/seq.py 3`; do > echo $x > "f$x" > hg add "f$x" > hg commit -m "Add $x" > done $ hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid $ cat hg.pid >> "$DAEMON_PIDS" $ cd .. $ hg clone --narrow --include f1 --include f2 http://localhost:$HGPORT1/ narrowclone1 requesting all changes adding changesets adding manifests adding file changes added 3 changesets with 2 changes to 2 files new changesets * (glob) updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved The tar should only contain f1 and f2 $ cd narrowclone1 $ hg archive -t tgz repo.tgz $ tar tfz repo.tgz repo/f1 repo/f2