Mercurial > public > mercurial-scm > hg
comparison mercurial/upgrade.py @ 46348:4a58561ace0f stable
share-share: have the hint issue more consistently and point to the right doc
This should help user in trouble to find solution in the documentation.
Differential Revision: https://phab.mercurial-scm.org/D9841
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 20 Jan 2021 12:23:40 +0100 |
parents | 4f17773fc6b5 |
children | 16c18d5e5dc8 |
comparison
equal
deleted
inserted
replaced
46347:5249ac2bc7a4 | 46348:4a58561ace0f |
---|---|
280 diffrequires.add(requirementsmod.SHARESAFE_REQUIREMENT) | 280 diffrequires.add(requirementsmod.SHARESAFE_REQUIREMENT) |
281 current_requirements.add(requirementsmod.SHARESAFE_REQUIREMENT) | 281 current_requirements.add(requirementsmod.SHARESAFE_REQUIREMENT) |
282 scmutil.writerequires(hgvfs, diffrequires) | 282 scmutil.writerequires(hgvfs, diffrequires) |
283 ui.warn(_(b'repository upgraded to use share-safe mode\n')) | 283 ui.warn(_(b'repository upgraded to use share-safe mode\n')) |
284 except error.LockError as e: | 284 except error.LockError as e: |
285 hint = _( | |
286 "see `hg help config.format.use-share-safe` for more information" | |
287 ) | |
285 if mismatch_config == b'upgrade-abort': | 288 if mismatch_config == b'upgrade-abort': |
286 raise error.Abort( | 289 raise error.Abort( |
287 _(b'failed to upgrade share, got error: %s') | 290 _(b'failed to upgrade share, got error: %s') |
288 % stringutil.forcebytestr(e.strerror) | 291 % stringutil.forcebytestr(e.strerror), |
292 hint=hint, | |
289 ) | 293 ) |
290 elif mismatch_warn: | 294 elif mismatch_warn: |
291 ui.warn( | 295 ui.warn( |
292 _(b'failed to upgrade share, got error: %s\n') | 296 _(b'failed to upgrade share, got error: %s\n') |
293 % stringutil.forcebytestr(e.strerror) | 297 % stringutil.forcebytestr(e.strerror), |
298 hint=hint, | |
294 ) | 299 ) |
295 finally: | 300 finally: |
296 if wlock: | 301 if wlock: |
297 wlock.release() | 302 wlock.release() |
298 | 303 |
332 current_requirements |= source_requirements | 337 current_requirements |= source_requirements |
333 current_requirements -= set(requirementsmod.SHARESAFE_REQUIREMENT) | 338 current_requirements -= set(requirementsmod.SHARESAFE_REQUIREMENT) |
334 scmutil.writerequires(hgvfs, current_requirements) | 339 scmutil.writerequires(hgvfs, current_requirements) |
335 ui.warn(_(b'repository downgraded to not use share-safe mode\n')) | 340 ui.warn(_(b'repository downgraded to not use share-safe mode\n')) |
336 except error.LockError as e: | 341 except error.LockError as e: |
342 hint = _( | |
343 "see `hg help config.format.use-share-safe` for more information" | |
344 ) | |
337 # If upgrade-abort is set, abort when upgrade fails, else let the | 345 # If upgrade-abort is set, abort when upgrade fails, else let the |
338 # process continue as `upgrade-allow` is set | 346 # process continue as `upgrade-allow` is set |
339 if mismatch_config == b'downgrade-abort': | 347 if mismatch_config == b'downgrade-abort': |
340 raise error.Abort( | 348 raise error.Abort( |
341 _(b'failed to downgrade share, got error: %s') | 349 _(b'failed to downgrade share, got error: %s') |
342 % stringutil.forcebytestr(e.strerror) | 350 % stringutil.forcebytestr(e.strerror), |
351 hint=hint, | |
343 ) | 352 ) |
344 elif mismatch_warn: | 353 elif mismatch_warn: |
345 ui.warn( | 354 ui.warn( |
346 _(b'failed to downgrade share, got error: %s\n') | 355 _(b'failed to downgrade share, got error: %s\n') |
347 % stringutil.forcebytestr(e.strerror) | 356 % stringutil.forcebytestr(e.strerror), |
357 hint=hint, | |
348 ) | 358 ) |
349 finally: | 359 finally: |
350 if wlock: | 360 if wlock: |
351 wlock.release() | 361 wlock.release() |