Mercurial > hg-stable
comparison mercurial/upgrade.py @ 46231:d3113c4cf52c
upgrade: don't perform anything if nothing to do
Before this patch, upgrade will process everything, re-clone all revlogs, write
requirements file again even there is no change to be made.
This patch makes it exit earlier.
Differential Revision: https://phab.mercurial-scm.org/D9695
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Fri, 08 Jan 2021 23:08:39 +0530 |
parents | e22aed089567 |
children | 0babe12ef35d |
comparison
equal
deleted
inserted
replaced
46230:1fcab88ab85c | 46231:d3113c4cf52c |
---|---|
169 ) | 169 ) |
170 ) | 170 ) |
171 upgrade_op.print_unused_optimizations() | 171 upgrade_op.print_unused_optimizations() |
172 return | 172 return |
173 | 173 |
174 if not (upgrade_op.upgrade_actions or upgrade_op.removed_actions): | |
175 ui.status(_(b'nothing to do\n')) | |
176 return | |
174 # Else we're in the run=true case. | 177 # Else we're in the run=true case. |
175 ui.write(_(b'upgrade will perform the following actions:\n\n')) | 178 ui.write(_(b'upgrade will perform the following actions:\n\n')) |
176 upgrade_op.print_requirements() | 179 upgrade_op.print_requirements() |
177 upgrade_op.print_optimisations() | 180 upgrade_op.print_optimisations() |
178 upgrade_op.print_upgrade_actions() | 181 upgrade_op.print_upgrade_actions() |