Mercurial > public > mercurial-scm > hg
comparison mercurial/upgrade.py @ 46221:0ca98ed828f9
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
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Thu, 31 Dec 2020 19:24:23 +0530 |
parents | 30310886d423 |
children | e22aed089567 |
comparison
equal
deleted
inserted
replaced
46220:1ca7865c245d | 46221:0ca98ed828f9 |
---|---|
203 | 203 |
204 with dstrepo.wlock(), dstrepo.lock(): | 204 with dstrepo.wlock(), dstrepo.lock(): |
205 backuppath = upgrade_engine.upgrade( | 205 backuppath = upgrade_engine.upgrade( |
206 ui, repo, dstrepo, upgrade_op | 206 ui, repo, dstrepo, upgrade_op |
207 ) | 207 ) |
208 if not (backup or backuppath is None): | 208 if not backup: |
209 ui.status( | 209 ui.status( |
210 _(b'removing old repository content %s\n') % backuppath | 210 _(b'removing old repository content %s\n') % backuppath |
211 ) | 211 ) |
212 repo.vfs.rmtree(backuppath, forcibly=True) | 212 repo.vfs.rmtree(backuppath, forcibly=True) |
213 backuppath = None | 213 backuppath = None |