Mercurial > hg
annotate tests/test-wireproto-command-lookup.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 | b1507ab0c6cf |
children |
rev | line source |
---|---|
37538
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
1 $ . $TESTDIR/wireprotohelpers.sh |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
2 |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
3 $ hg init server |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
4 $ enablehttpv2 server |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
5 $ cd server |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
6 $ cat >> .hg/hgrc << EOF |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
7 > [web] |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
8 > push_ssl = false |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
9 > allow-push = * |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
10 > EOF |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
11 $ hg debugdrawdag << EOF |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
12 > C D |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
13 > |/ |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
14 > B |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
15 > | |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
16 > A |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
17 > EOF |
45109
b1507ab0c6cf
tests: avoid a "magic" nodeid in test-wireproto-command-lookup.t
Martin von Zweigbergk <martinvonz@google.com>
parents:
40048
diff
changeset
|
18 $ root_node=$(hg log -r A -T '{node}') |
37538
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
19 |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
20 $ hg serve -p $HGPORT -d --pid-file hg.pid -E error.log |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
21 $ cat hg.pid > $DAEMON_PIDS |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
22 |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
23 lookup for known node works |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
24 |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
25 $ sendhttpv2peer << EOF |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
26 > command lookup |
45109
b1507ab0c6cf
tests: avoid a "magic" nodeid in test-wireproto-command-lookup.t
Martin von Zweigbergk <martinvonz@google.com>
parents:
40048
diff
changeset
|
27 > key $root_node |
37538
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
28 > EOF |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
29 creating http peer for wire protocol version 2 |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
30 sending lookup command |
37721
f7673845b167
wireprotov2: decode responses to their expected types
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37718
diff
changeset
|
31 response: b'Bk\xad\xa5\xc6u\x98\xcae\x03mW\xd9\xe4\xb6K\x0c\x1c\xe7\xa0' |
37538
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
32 |
89fed81bbb6c
wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
33 $ cat error.log |