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.
13 jobs for topic/default/upgrade-refactor in 26 minutes and 55 seconds (queued for 3 seconds)
Status Name Job ID Coverage
  Tests
passed checks-py2 #160477

00:05:25

passed checks-py3 #160478

00:02:36

passed rust-cargo-test-py2 #160479

00:02:35

passed rust-cargo-test-py3 #160480

00:03:08

failed test-py2 #160481

00:23:21

failed test-py2-chg #160487

00:22:14

failed test-py2-pure #160483

00:21:04

failed test-py2-rust #160485

00:24:15

passed test-py3 #160482

00:20:27

passed test-py3-chg #160488

00:08:55

passed test-py3-pure #160484

00:20:50

passed test-py3-rust #160486

00:19:46

 
  Phabricator
skipped phabricator-refresh #160489
 
Name Stage Failure
failed
test-py2-rust Tests
Skipped test-sparse-fsmonitor.t: skipped
Skipped test-sparse-revlog.t: missing artifact, run "/tmp/mercurial-ci/tests/artifacts/scripts/generate-churning-bundle.py"
Skipped test-verify-repo-operations.py: missing feature: allow slow tests (use --allow-slow-tests)
Failed test-install.t: output changed
# Ran 892 tests, 56 skipped, 1 failed.
python hash seed: 2905048846
Running after_script
Uploading artifacts for failed job
ERROR: Job failed: exit code 1
failed
test-py2-chg Tests
Skipped test-update-atomic.t: system supports running with chg
Skipped test-verify-repo-operations.py: missing feature: allow slow tests (use --allow-slow-tests)
Skipped test-wireproto-command-capabilities.t: system supports running with chg
Failed test-install.t: output changed
# Ran 871 tests, 77 skipped, 1 failed.
python hash seed: 3590421834
Running after_script
Uploading artifacts for failed job
ERROR: Job failed: exit code 1
failed
test-py2 Tests
Skipped test-sparse-fsmonitor.t: skipped
Skipped test-sparse-revlog.t: missing artifact, run "/tmp/mercurial-ci/tests/artifacts/scripts/generate-churning-bundle.py"
Skipped test-verify-repo-operations.py: missing feature: allow slow tests (use --allow-slow-tests)
Failed test-install.t: output changed
# Ran 892 tests, 56 skipped, 1 failed.
python hash seed: 2839922792
Running after_script
Uploading artifacts for failed job
ERROR: Job failed: exit code 1
failed
test-py2-pure Tests
Skipped test-sparse-fsmonitor.t: skipped
Skipped test-sparse-revlog.t: missing artifact, run "/tmp/mercurial-ci/tests/artifacts/scripts/generate-churning-bundle.py"
Skipped test-verify-repo-operations.py: missing feature: allow slow tests (use --allow-slow-tests)
Failed test-install.t: output changed
# Ran 889 tests, 59 skipped, 1 failed.
python hash seed: 1596505476
Running after_script
Uploading artifacts for failed job
ERROR: Job failed: exit code 1