upgrade: remove unnecessary `is None` check
authorPulkit Goyal <7895pulkit@gmail.com>
Thu, 31 Dec 2020 19:24:23 +0530
changeset 46221 0ca98ed828f9
parent 46220 1ca7865c245d
child 46222 e22aed089567
upgrade: remove unnecessary `is None` check `upgrade_engine.upgrade()` always return the `backuppath` value and there are not early returns. Hence I don't see how `backuppath` can be None. Adding extra unncessary safe checks hides unknown bugs. Hence removing it. Differential Revision: https://phab.mercurial-scm.org/D9675
mercurial/upgrade.py
--- a/mercurial/upgrade.py	Thu Dec 31 14:45:16 2020 +0530
+++ b/mercurial/upgrade.py	Thu Dec 31 19:24:23 2020 +0530
@@ -205,7 +205,7 @@
                 backuppath = upgrade_engine.upgrade(
                     ui, repo, dstrepo, upgrade_op
                 )
-            if not (backup or backuppath is None):
+            if not backup:
                 ui.status(
                     _(b'removing old repository content %s\n') % backuppath
                 )