Mercurial > hg
annotate tests/test-missing-capability.t @ 46472:98e39f04d60e
upgrade: implement partial upgrade for upgrading persistent-nodemap
Upgrading repositories to use persistent nodemap should be fast and easy as it
requires only two things:
1) Updating the requirements
2) Writing a persistent-nodemap on disk
For both of the steps above, we don't need to edit existing revlogs.
This patch makes upgrade only do the above mentioned two steps if we are
only upgarding to use persistent-nodemap feature.
Since `nodemap.persist_nodemap()` assumes that there exists a nodemap file for
the given revlog if we are trying to call it, this patch adds `force` argument
to create a file if does not exist which is true in our upgrade case.
The test changes demonstrate that we no longer write nodemap files for manifest
after upgrade which I think is desirable.
Differential Revision: https://phab.mercurial-scm.org/D9936
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Mon, 01 Feb 2021 00:02:00 +0530 |
parents | 8d72e29ad1e0 |
children | 9c4204b7f3e4 |
rev | line source |
---|---|
41055
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
1 Checking how hg behaves when one side of a pull/push doesn't support |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
2 some capability (because it's running an older hg version, usually). |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
3 |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
4 $ hg init repo1 |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
5 $ cd repo1 |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
6 $ echo a > a; hg add -q a; hg commit -q -m a |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
7 $ hg bookmark a |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
8 $ hg clone -q . ../repo2 |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
9 $ cd ../repo2 |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
10 |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
11 $ touch $TESTTMP/disable-lookup.py |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
12 $ disable_cap() { |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
13 > rm -f $TESTTMP/disable-lookup.pyc # pyc caching is buggy |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
14 > cat <<EOF > $TESTTMP/disable-lookup.py |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
15 > from mercurial import extensions, wireprotov1server |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
16 > def wcapabilities(orig, *args, **kwargs): |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
17 > cap = orig(*args, **kwargs) |
41313
d3cc9a8df63a
tests: add b'' to test-missing-capability.t
Gregory Szorc <gregory.szorc@gmail.com>
parents:
41055
diff
changeset
|
18 > cap.remove(b'$1') |
41055
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
19 > return cap |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
20 > extensions.wrapfunction(wireprotov1server, '_capabilities', wcapabilities) |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
21 > EOF |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
22 > } |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
23 $ cat >> ../repo1/.hg/hgrc <<EOF |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
24 > [extensions] |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
25 > disable-lookup = $TESTTMP/disable-lookup.py |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
26 > EOF |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
27 $ cat >> .hg/hgrc <<EOF |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
28 > [ui] |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
29 > ssh = "$PYTHON" "$TESTDIR/dummyssh" |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
30 > EOF |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
31 |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
32 $ hg pull ssh://user@dummy/repo1 -r tip -B a |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
33 pulling from ssh://user@dummy/repo1 |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
34 no changes found |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
35 |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
36 $ disable_cap lookup |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
37 $ hg pull ssh://user@dummy/repo1 -r tip -B a |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
38 pulling from ssh://user@dummy/repo1 |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
39 abort: other repository doesn't support revision lookup, so a rev cannot be specified. |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
40 [255] |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
41 |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
42 $ disable_cap pushkey |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
43 $ hg pull ssh://user@dummy/repo1 -r tip -B a |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
44 pulling from ssh://user@dummy/repo1 |
55e8da487b8a
wireproto: in batch queries, support queries with immediate responses
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
45 abort: remote bookmark a not found! |
45827
8d72e29ad1e0
errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents:
41313
diff
changeset
|
46 [10] |