Show More
@@ -957,6 +957,9 b' https://www.mercurial-scm.org/wiki/Missi' | |||
|
957 | 957 | change is needed. This also applies to operations that would have been |
|
958 | 958 | read-only (like hg status). |
|
959 | 959 | |
|
960 | If the repository cannot be locked, the automatic-upgrade operation will be | |
|
961 | skipped. The next operation will attempt it again. | |
|
962 | ||
|
960 | 963 | This configuration will apply for moves in any direction, either adding the |
|
961 | 964 | `dirstate-v2` format if `format.use-dirstate-v2=yes` or removing the |
|
962 | 965 | `dirstate-v2` requirement if `format.use-dirstate-v2=no`. So we recommend |
@@ -1008,6 +1011,9 b' https://www.mercurial-scm.org/wiki/Missi' | |||
|
1008 | 1011 | triggers if a change is needed. This also applies to operations that would |
|
1009 | 1012 | have been read-only (like hg status). |
|
1010 | 1013 | |
|
1014 | If the repository cannot be locked, the automatic-upgrade operation will be | |
|
1015 | skipped. The next operation will attempt it again. | |
|
1016 | ||
|
1011 | 1017 | This configuration will apply for moves in any direction, either adding the |
|
1012 | 1018 | `dirstate-tracked-hint` format if `format.use-dirstate-tracked-hint=yes` or |
|
1013 | 1019 | removing the `dirstate-tracked-hint` requirement if |
@@ -1084,6 +1090,9 b' https://www.mercurial-scm.org/wiki/Missi' | |||
|
1084 | 1090 | change is needed. This also applies to operation that would have been |
|
1085 | 1091 | read-only (like hg status). |
|
1086 | 1092 | |
|
1093 | If the repository cannot be locked, the automatic-upgrade operation will be | |
|
1094 | skipped. The next operation will attempt it again. | |
|
1095 | ||
|
1087 | 1096 | This configuration will apply for moves in any direction, either adding the |
|
1088 | 1097 | `share-safe` format if `format.use-share-safe=yes` or removing the |
|
1089 | 1098 | `share-safe` requirement if `format.use-share-safe=no`. So we recommend |
@@ -217,19 +217,26 b' def may_auto_upgrade(repo, maker_func):' | |||
|
217 | 217 | |
|
218 | 218 | loop = 0 |
|
219 | 219 | |
|
220 | while not clear: | |
|
221 | loop += 1 | |
|
222 |
|
|
|
223 | # XXX basic protection against infinite loop, make it better. | |
|
224 | raise error.ProgrammingError("Too many auto upgrade loops") | |
|
225 | clear = True | |
|
226 | for get_action in AUTO_UPGRADE_ACTIONS: | |
|
227 | action = get_action(repo) | |
|
228 |
|
|
|
229 | clear = False | |
|
230 | with repo.wlock(wait=False), repo.lock(wait=False): | |
|
231 | action = get_action(repo) | |
|
232 |
|
|
|
233 |
action |
|
|
234 |
|
|
|
220 | try: | |
|
221 | while not clear: | |
|
222 | loop += 1 | |
|
223 | if loop > 100: | |
|
224 | # XXX basic protection against infinite loop, make it better. | |
|
225 | raise error.ProgrammingError("Too many auto upgrade loops") | |
|
226 | clear = True | |
|
227 | for get_action in AUTO_UPGRADE_ACTIONS: | |
|
228 | action = get_action(repo) | |
|
229 | if action is not None: | |
|
230 | clear = False | |
|
231 | with repo.wlock(wait=False), repo.lock(wait=False): | |
|
232 | action = get_action(repo) | |
|
233 | if action is not None: | |
|
234 | action() | |
|
235 | repo = maker_func() | |
|
236 | except error.LockError: | |
|
237 | # if we cannot get the lock, ignore the auto-upgrade attemps and | |
|
238 | # proceed. We might want to make this behavior configurable in the | |
|
239 | # future. | |
|
240 | pass | |
|
241 | ||
|
235 | 242 | return repo |
@@ -2069,8 +2069,6 b' Attempting Auto-upgrade on a read-only r' | |||
|
2069 | 2069 | $ hg status -R auto-upgrade \ |
|
2070 | 2070 | > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \ |
|
2071 | 2071 | > --config format.use-dirstate-v2=no |
|
2072 | abort: could not lock working directory of auto-upgrade: Permission denied | |
|
2073 | [20] | |
|
2074 | 2072 | $ hg debugformat -R auto-upgrade | grep dirstate-v2 |
|
2075 | 2073 | dirstate-v2: yes |
|
2076 | 2074 | |
@@ -2085,8 +2083,6 b' Attempting Auto-upgrade on a locked repo' | |||
|
2085 | 2083 | $ hg status -R auto-upgrade \ |
|
2086 | 2084 | > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \ |
|
2087 | 2085 | > --config format.use-dirstate-v2=no |
|
2088 | abort: repository auto-upgrade: timed out waiting for lock held by 'brunhoff/effffffc:1215708' | |
|
2089 | [20] | |
|
2090 | 2086 | $ hg debugformat -R auto-upgrade | grep dirstate-v2 |
|
2091 | 2087 | dirstate-v2: yes |
|
2092 | 2088 |
General Comments 0
You need to be logged in to leave comments.
Login now