Show More
@@ -957,6 +957,9 b' https://www.mercurial-scm.org/wiki/Missi' | |||||
957 | change is needed. This also applies to operations that would have been |
|
957 | change is needed. This also applies to operations that would have been | |
958 | read-only (like hg status). |
|
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 | This configuration will apply for moves in any direction, either adding the |
|
963 | This configuration will apply for moves in any direction, either adding the | |
961 | `dirstate-v2` format if `format.use-dirstate-v2=yes` or removing the |
|
964 | `dirstate-v2` format if `format.use-dirstate-v2=yes` or removing the | |
962 | `dirstate-v2` requirement if `format.use-dirstate-v2=no`. So we recommend |
|
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 | triggers if a change is needed. This also applies to operations that would |
|
1011 | triggers if a change is needed. This also applies to operations that would | |
1009 | have been read-only (like hg status). |
|
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 | This configuration will apply for moves in any direction, either adding the |
|
1017 | This configuration will apply for moves in any direction, either adding the | |
1012 | `dirstate-tracked-hint` format if `format.use-dirstate-tracked-hint=yes` or |
|
1018 | `dirstate-tracked-hint` format if `format.use-dirstate-tracked-hint=yes` or | |
1013 | removing the `dirstate-tracked-hint` requirement if |
|
1019 | removing the `dirstate-tracked-hint` requirement if | |
@@ -1084,6 +1090,9 b' https://www.mercurial-scm.org/wiki/Missi' | |||||
1084 | change is needed. This also applies to operation that would have been |
|
1090 | change is needed. This also applies to operation that would have been | |
1085 | read-only (like hg status). |
|
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 | This configuration will apply for moves in any direction, either adding the |
|
1096 | This configuration will apply for moves in any direction, either adding the | |
1088 | `share-safe` format if `format.use-share-safe=yes` or removing the |
|
1097 | `share-safe` format if `format.use-share-safe=yes` or removing the | |
1089 | `share-safe` requirement if `format.use-share-safe=no`. So we recommend |
|
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 | loop = 0 |
|
218 | loop = 0 | |
219 |
|
219 | |||
220 | while not clear: |
|
220 | try: | |
221 | loop += 1 |
|
221 | while not clear: | |
222 |
|
|
222 | loop += 1 | |
223 | # XXX basic protection against infinite loop, make it better. |
|
223 | if loop > 100: | |
224 | raise error.ProgrammingError("Too many auto upgrade loops") |
|
224 | # XXX basic protection against infinite loop, make it better. | |
225 | clear = True |
|
225 | raise error.ProgrammingError("Too many auto upgrade loops") | |
226 | for get_action in AUTO_UPGRADE_ACTIONS: |
|
226 | clear = True | |
227 | action = get_action(repo) |
|
227 | for get_action in AUTO_UPGRADE_ACTIONS: | |
228 |
|
|
228 | action = get_action(repo) | |
229 | clear = False |
|
229 | if action is not None: | |
230 | with repo.wlock(wait=False), repo.lock(wait=False): |
|
230 | clear = False | |
231 | action = get_action(repo) |
|
231 | with repo.wlock(wait=False), repo.lock(wait=False): | |
232 |
|
|
232 | action = get_action(repo) | |
233 |
action |
|
233 | if action is not None: | |
234 |
|
|
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 | return repo |
|
242 | return repo |
@@ -2069,8 +2069,6 b' Attempting Auto-upgrade on a read-only r' | |||||
2069 | $ hg status -R auto-upgrade \ |
|
2069 | $ hg status -R auto-upgrade \ | |
2070 | > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \ |
|
2070 | > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \ | |
2071 | > --config format.use-dirstate-v2=no |
|
2071 | > --config format.use-dirstate-v2=no | |
2072 | abort: could not lock working directory of auto-upgrade: Permission denied |
|
|||
2073 | [20] |
|
|||
2074 | $ hg debugformat -R auto-upgrade | grep dirstate-v2 |
|
2072 | $ hg debugformat -R auto-upgrade | grep dirstate-v2 | |
2075 | dirstate-v2: yes |
|
2073 | dirstate-v2: yes | |
2076 |
|
2074 | |||
@@ -2085,8 +2083,6 b' Attempting Auto-upgrade on a locked repo' | |||||
2085 | $ hg status -R auto-upgrade \ |
|
2083 | $ hg status -R auto-upgrade \ | |
2086 | > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \ |
|
2084 | > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \ | |
2087 | > --config format.use-dirstate-v2=no |
|
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 | $ hg debugformat -R auto-upgrade | grep dirstate-v2 |
|
2086 | $ hg debugformat -R auto-upgrade | grep dirstate-v2 | |
2091 | dirstate-v2: yes |
|
2087 | dirstate-v2: yes | |
2092 |
|
2088 |
General Comments 0
You need to be logged in to leave comments.
Login now