changeset 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 3e3b81b6e7da
children 83f037acf71a
files mercurial/upgrade_utils/engine.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/upgrade_utils/engine.py	Mon Jan 25 14:23:47 2021 +0530
+++ b/mercurial/upgrade_utils/engine.py	Sun Jan 31 23:13:08 2021 +0530
@@ -449,7 +449,10 @@
         )
     )
 
-    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 @@
             # 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