Page MenuHomePhabricator

upgrade: remove unnecessary `is None` check
ClosedPublic

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

Details

Summary

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

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

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.