Mercurial > hg
annotate tests/test-sparse-clear.t @ 37533:df4985497986
wireproto: implement capabilities for wire protocol v2
The capabilities mechanism for wire protocol version 2 represents a
clean break from version 1.
Instead of effectively exchanging a set of capabilities, we're
exchanging a rich data structure.
This data structure currently contains information about
every available command, including its accepted arguments. It also
contains information about supported compression formats.
Exposing information about supported commands will allow clients
to automatically generate bindings to the server. Clients will be
able to do things like detect when they are attempting to run a
command that isn't known to the server. Exposing the required
permissions to run a command can be used by clients to determine if
they have privileges to call a command before actually calling it.
We could potentially even have clients send credentials
preemptively without waiting for the server to deny the command
request. Lots of potential here.
The data returned by this command will likely evolve heavily. So we
shouldn't bikeshed the implementation just yet.
Differential Revision: https://phab.mercurial-scm.org/D3200
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 09 Apr 2018 11:52:31 -0700 |
parents | c9cbf4de27ba |
children | 5c2a4f37eace |
rev | line source |
---|---|
33289
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
1 test sparse |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
2 |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
3 $ hg init myrepo |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
4 $ cd myrepo |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
5 $ cat >> $HGRCPATH <<EOF |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
6 > [extensions] |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
7 > sparse= |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
8 > purge= |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
9 > strip= |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
10 > rebase= |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
11 > EOF |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
12 |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
13 $ echo a > index.html |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
14 $ echo x > data.py |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
15 $ echo z > readme.txt |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
16 $ cat > base.sparse <<EOF |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
17 > [include] |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
18 > *.sparse |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
19 > EOF |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
20 $ hg ci -Aqm 'initial' |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
21 $ cat > webpage.sparse <<EOF |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
22 > %include base.sparse |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
23 > [include] |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
24 > *.html |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
25 > EOF |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
26 $ hg ci -Aqm 'initial' |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
27 |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
28 Clear rules when there are includes |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
29 |
33293
c9cbf4de27ba
sparse: rename command to debugsparse
Gregory Szorc <gregory.szorc@gmail.com>
parents:
33289
diff
changeset
|
30 $ hg debugsparse --include *.py |
33289
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
31 $ ls |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
32 data.py |
33293
c9cbf4de27ba
sparse: rename command to debugsparse
Gregory Szorc <gregory.szorc@gmail.com>
parents:
33289
diff
changeset
|
33 $ hg debugsparse --clear-rules |
33289
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
34 $ ls |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
35 base.sparse |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
36 data.py |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
37 index.html |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
38 readme.txt |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
39 webpage.sparse |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
40 |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
41 Clear rules when there are excludes |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
42 |
33293
c9cbf4de27ba
sparse: rename command to debugsparse
Gregory Szorc <gregory.szorc@gmail.com>
parents:
33289
diff
changeset
|
43 $ hg debugsparse --exclude *.sparse |
33289
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
44 $ ls |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
45 data.py |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
46 index.html |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
47 readme.txt |
33293
c9cbf4de27ba
sparse: rename command to debugsparse
Gregory Szorc <gregory.szorc@gmail.com>
parents:
33289
diff
changeset
|
48 $ hg debugsparse --clear-rules |
33289
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
49 $ ls |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
50 base.sparse |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
51 data.py |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
52 index.html |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
53 readme.txt |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
54 webpage.sparse |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
55 |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
56 Clearing rules should not alter profiles |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
57 |
33293
c9cbf4de27ba
sparse: rename command to debugsparse
Gregory Szorc <gregory.szorc@gmail.com>
parents:
33289
diff
changeset
|
58 $ hg debugsparse --enable-profile webpage.sparse |
33289
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
59 $ ls |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
60 base.sparse |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
61 index.html |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
62 webpage.sparse |
33293
c9cbf4de27ba
sparse: rename command to debugsparse
Gregory Szorc <gregory.szorc@gmail.com>
parents:
33289
diff
changeset
|
63 $ hg debugsparse --include *.py |
33289
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
64 $ ls |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
65 base.sparse |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
66 data.py |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
67 index.html |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
68 webpage.sparse |
33293
c9cbf4de27ba
sparse: rename command to debugsparse
Gregory Szorc <gregory.szorc@gmail.com>
parents:
33289
diff
changeset
|
69 $ hg debugsparse --clear-rules |
33289
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
70 $ ls |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
71 base.sparse |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
72 index.html |
abd7dedbaa36
sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
73 webpage.sparse |