# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2020-12-31 13:54:23 # Node ID 0ca98ed828f9cb7d66cd0dd22bee2bffb87ec23c # Parent 1ca7865c245db32f69e5b05b75489b7cae147f9b 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 diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py --- a/mercurial/upgrade.py +++ b/mercurial/upgrade.py @@ -205,7 +205,7 @@ def upgraderepo( 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 )