# HG changeset patch # User Pierre-Yves David # Date 1686815489 -7200 # Node ID c96fd53c0e2db9d3c3591e4c4ab3edf061fa9182 # Parent 9d4a2ea3dcb961ea7d30aca3e09d01c9678a1116 path: display proper user facing value for pulled-delta-reuse-policy The integer was not what the user expect nor what could be provided as a config value. diff -r 9d4a2ea3dcb9 -r c96fd53c0e2d mercurial/utils/urlutil.py --- a/mercurial/utils/urlutil.py Thu Jun 15 09:50:46 2023 +0200 +++ b/mercurial/utils/urlutil.py Thu Jun 15 09:51:29 2023 +0200 @@ -746,9 +746,14 @@ b'no-reuse': revlog_constants.DELTA_BASE_REUSE_NO, b'forced': revlog_constants.DELTA_BASE_REUSE_FORCE, } +DELTA_REUSE_POLICIES_NAME = dict(i[::-1] for i in DELTA_REUSE_POLICIES.items()) -@pathsuboption(b'pulled-delta-reuse-policy', b'delta_reuse_policy') +@pathsuboption( + b'pulled-delta-reuse-policy', + b'delta_reuse_policy', + display=DELTA_REUSE_POLICIES_NAME.get, +) def delta_reuse_policy(ui, path, value): if value not in DELTA_REUSE_POLICIES: path_name = path.name diff -r 9d4a2ea3dcb9 -r c96fd53c0e2d tests/test-pullling-to-general-delta.t --- a/tests/test-pullling-to-general-delta.t Thu Jun 15 09:50:46 2023 +0200 +++ b/tests/test-pullling-to-general-delta.t Thu Jun 15 09:51:29 2023 +0200 @@ -180,7 +180,7 @@ $ cp -R client client-forced $ hg -R client-forced paths --config paths.default:pulled-delta-reuse-policy=forced default = $TESTTMP/server - default:pulled-delta-reuse-policy = 2 + default:pulled-delta-reuse-policy = forced $ hg -R client-forced pull --config paths.default:pulled-delta-reuse-policy=forced pulling from $TESTTMP/server requesting all changes