Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hg.py @ 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 | a61287a95dc3 |
children | 2b6632d64328 |
comparison
equal
deleted
inserted
replaced
44239:df2162672d24 | 44240:abcc82bf0717 |
---|---|
1038 | 1038 |
1039 | 1039 |
1040 def clean(repo, node, show_stats=True, quietempty=False): | 1040 def clean(repo, node, show_stats=True, quietempty=False): |
1041 """forcibly switch the working directory to node, clobbering changes""" | 1041 """forcibly switch the working directory to node, clobbering changes""" |
1042 stats = updaterepo(repo, node, True) | 1042 stats = updaterepo(repo, node, True) |
1043 assert stats.unresolvedcount == 0 | |
1043 repo.vfs.unlinkpath(b'graftstate', ignoremissing=True) | 1044 repo.vfs.unlinkpath(b'graftstate', ignoremissing=True) |
1044 if show_stats: | 1045 if show_stats: |
1045 _showstats(repo, stats, quietempty) | 1046 _showstats(repo, stats, quietempty) |
1046 return stats.unresolvedcount > 0 | |
1047 | 1047 |
1048 | 1048 |
1049 # naming conflict in updatetotally() | 1049 # naming conflict in updatetotally() |
1050 _clean = clean | 1050 _clean = clean |
1051 | 1051 |