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
--- 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