# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2021-01-31 17:43:08 # Node ID 45c3a263d5d1464aa61e59f4d376a5fd9438125a # Parent 3e3b81b6e7da5fdf8250c0ef7e4c5df0f954ca91 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 diff --git a/mercurial/upgrade_utils/engine.py b/mercurial/upgrade_utils/engine.py --- a/mercurial/upgrade_utils/engine.py +++ b/mercurial/upgrade_utils/engine.py @@ -449,7 +449,10 @@ def upgrade(ui, srcrepo, dstrepo, upgrad ) ) - if not upgrade_op.requirements_only: + if upgrade_op.requirements_only: + ui.status(_(b'upgrading repository requirements\n')) + scmutil.writereporequirements(srcrepo, upgrade_op.new_requirements) + else: with dstrepo.transaction(b'upgrade') as tr: _clonerevlogs( ui, @@ -532,8 +535,5 @@ def upgrade(ui, srcrepo, dstrepo, upgrad # could update srcrepo.svfs and other variables to point to the new # location. This is simpler. backupvfs.unlink(b'store/lock') - else: - ui.status(_(b'upgrading repository requirements\n')) - scmutil.writereporequirements(srcrepo, upgrade_op.new_requirements) return backuppath