This is an archive of the discontinued Mercurial Phabricator instance.

upgrade: remove unnecessary `is None` check

Authored by pulkit on Dec 31 2020, 11:43 AM.



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.

Diff Detail

rHG Mercurial
No Linters Available
No Unit Test Coverage

Event Timeline

pulkit created this revision.Dec 31 2020, 11:43 AM

If we did nothing, we might not have a backup ?

If we did nothing, we might not have a backup ?

For now, upgrade_engine.upgrade always does something. IOW, if we run hg debugupgraderepo --run, even if there is nothing to upgrade, we process everything. This will be fixed in an upcoming patch.

mharbison72 accepted this revision.Jan 12 2021, 8:51 PM
This revision is now accepted and ready to land.Jan 12 2021, 8:51 PM
This revision was automatically updated to reflect the committed changes.