comparison mercurial/upgrade_utils/engine.py @ 46467:45c3a263d5d1

engine: 'if not, else' -> 'if, else' I personally feel that ``` if x: pass else: pass ``` is easier to read and edit than ``` if not x: pass else: pass ``` Next patches will add one more if-else clause. Differential Revision: https://phab.mercurial-scm.org/D9931
author Pulkit Goyal <7895pulkit@gmail.com>
date Sun, 31 Jan 2021 23:13:08 +0530
parents f2c4224e6648
children 98e39f04d60e
comparison
equal deleted inserted replaced
46466:3e3b81b6e7da 46467:45c3a263d5d1
447 b'(it is safe to interrupt this process any time before ' 447 b'(it is safe to interrupt this process any time before '
448 b'data migration completes)\n' 448 b'data migration completes)\n'
449 ) 449 )
450 ) 450 )
451 451
452 if not upgrade_op.requirements_only: 452 if upgrade_op.requirements_only:
453 ui.status(_(b'upgrading repository requirements\n'))
454 scmutil.writereporequirements(srcrepo, upgrade_op.new_requirements)
455 else:
453 with dstrepo.transaction(b'upgrade') as tr: 456 with dstrepo.transaction(b'upgrade') as tr:
454 _clonerevlogs( 457 _clonerevlogs(
455 ui, 458 ui,
456 srcrepo, 459 srcrepo,
457 dstrepo, 460 dstrepo,
530 # The lock file from the old store won't be removed because nothing has a 533 # The lock file from the old store won't be removed because nothing has a
531 # reference to its new location. So clean it up manually. Alternatively, we 534 # reference to its new location. So clean it up manually. Alternatively, we
532 # could update srcrepo.svfs and other variables to point to the new 535 # could update srcrepo.svfs and other variables to point to the new
533 # location. This is simpler. 536 # location. This is simpler.
534 backupvfs.unlink(b'store/lock') 537 backupvfs.unlink(b'store/lock')
535 else:
536 ui.status(_(b'upgrading repository requirements\n'))
537 scmutil.writereporequirements(srcrepo, upgrade_op.new_requirements)
538 538
539 return backuppath 539 return backuppath