Mercurial > public > mercurial-scm > hg
comparison mercurial/configitems.py @ 46332:cc3452d2dfa4
share: rework config options to be much clearer and easier
Recently I implemented various boolean configs which control how to behave when
there is a share-safe mismatch between source and share repository. Mismatch
means that source supports share-safe where as share does not or vice versa.
However, while discussion and documentation we realized that it's too
complicated and there are some combinations of values which makes no sense.
We decided to introduce a config option with 4 possible values which
makes controlling and understanding things easier.
The config option `share.safe-mismatch.source-{not-}safe` can have
following 4 values:
* abort (default): error out if there is mismatch
* allow: allow to work with respecting share source configuration
* {up|down}grade-abort: try to {up|down}grade, if it fails, abort
* {up|down}grade-allow: try to {up|down}grade, if it fails, continue in allow
mode
I am not sure if I can explain 3 config options which I deleted right now in
just 5 lines which is a sign of how complex they became.
No test changes demonstrate that functionality is same, only names have changed.
Differential Revision: https://phab.mercurial-scm.org/D9785
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Mon, 18 Jan 2021 21:37:20 +0530 |
parents | 6ee9bd69ff7f |
children | 2eb5fe13461b |
comparison
equal
deleted
inserted
replaced
46331:8788981c95f8 | 46332:cc3452d2dfa4 |
---|---|
1096 b'server.stream-narrow-clones', | 1096 b'server.stream-narrow-clones', |
1097 default=False, | 1097 default=False, |
1098 ) | 1098 ) |
1099 coreconfigitem( | 1099 coreconfigitem( |
1100 b'experimental', | 1100 b'experimental', |
1101 b'sharesafe-auto-downgrade-shares', | |
1102 default=False, | |
1103 ) | |
1104 coreconfigitem( | |
1105 b'experimental', | |
1106 b'sharesafe-auto-upgrade-shares', | |
1107 default=False, | |
1108 ) | |
1109 coreconfigitem( | |
1110 b'experimental', | |
1111 b'sharesafe-auto-upgrade-fail-error', | |
1112 default=False, | |
1113 ) | |
1114 coreconfigitem( | |
1115 b'experimental', | |
1116 b'sharesafe-warn-outdated-shares', | 1101 b'sharesafe-warn-outdated-shares', |
1117 default=True, | 1102 default=True, |
1118 ) | 1103 ) |
1119 coreconfigitem( | 1104 coreconfigitem( |
1120 b'experimental', | 1105 b'experimental', |
1924 b'share', | 1909 b'share', |
1925 b'poolnaming', | 1910 b'poolnaming', |
1926 default=b'identity', | 1911 default=b'identity', |
1927 ) | 1912 ) |
1928 coreconfigitem( | 1913 coreconfigitem( |
1914 b'share', | |
1915 b'safe-mismatch.source-not-safe', | |
1916 default=b'abort', | |
1917 ) | |
1918 coreconfigitem( | |
1919 b'share', | |
1920 b'safe-mismatch.source-safe', | |
1921 default=b'abort', | |
1922 ) | |
1923 coreconfigitem( | |
1929 b'shelve', | 1924 b'shelve', |
1930 b'maxbackups', | 1925 b'maxbackups', |
1931 default=10, | 1926 default=10, |
1932 ) | 1927 ) |
1933 coreconfigitem( | 1928 coreconfigitem( |