Mercurial > hg-stable
changeset 44240:abcc82bf0717
clean: check that there are no conflicts after
As noted by Pulkit, there should never be any conflicts after doing a
clean update, so `hg.clean()` should never return `True`. Let's check
that assertion instead to clarify the code. The callers will now get a
`None` instead of a `False` returned, but that should be fine (both
result in a 0 exit status).
Differential Revision: https://phab.mercurial-scm.org/D7984
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 24 Jan 2020 09:33:02 -0800 |
parents | df2162672d24 |
children | d7622fdec3b5 |
files | mercurial/hg.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/hg.py Fri Jan 24 14:32:53 2020 -0800 +++ b/mercurial/hg.py Fri Jan 24 09:33:02 2020 -0800 @@ -1040,10 +1040,10 @@ def clean(repo, node, show_stats=True, quietempty=False): """forcibly switch the working directory to node, clobbering changes""" stats = updaterepo(repo, node, True) + assert stats.unresolvedcount == 0 repo.vfs.unlinkpath(b'graftstate', ignoremissing=True) if show_stats: _showstats(repo, stats, quietempty) - return stats.unresolvedcount > 0 # naming conflict in updatetotally()