Mercurial > hg
changeset 19814:4495c6a272e0
mq: extract checklocalchanges from `mq.queue`
The core part of `checklocalchanges` is now mq independent. We can extract it in
a standalone function to help the extraction of `strip` as discussed in issue3824.
A `checklocalchanges` function stay in `mq.queue` with the part related to
"refresh first" messages.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Wed, 25 Sep 2013 12:43:14 +0200 |
parents | 76796fe65bad |
children | 378567bf9f74 |
files | hgext/mq.py |
diffstat | 1 files changed, 13 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/mq.py Wed Sep 25 11:24:43 2013 +0200 +++ b/hgext/mq.py Wed Sep 25 12:43:14 2013 +0200 @@ -964,16 +964,7 @@ # plain versions for i18n tool to detect them _("local changes found, refresh first") _("local changed subrepos found, refresh first") - cmdutil.checkunfinished(repo) - m, a, r, d = repo.status()[:4] - if not force: - if (m or a or r or d): - _("local changes found") # i18n tool detection - raise util.Abort(_("local changes found" + excsuffix)) - if checksubstate(repo): - _("local changed subrepos found") # i18n tool detection - raise util.Abort(_("local changed subrepos found" + excsuffix)) - return m, a, r, d + return checklocalchanges(repo, force, excsuffix) _reserved = ('series', 'status', 'guards', '.', '..') def checkreservedname(self, name): @@ -2931,6 +2922,18 @@ inclsubs.append(s) return inclsubs +def checklocalchanges(repo, force=False, excsuffix=''): + cmdutil.checkunfinished(repo) + m, a, r, d = repo.status()[:4] + if not force: + if (m or a or r or d): + _("local changes found") # i18n tool detection + raise util.Abort(_("local changes found" + excsuffix)) + if checksubstate(repo): + _("local changed subrepos found") # i18n tool detection + raise util.Abort(_("local changed subrepos found" + excsuffix)) + return m, a, r, d + @command("strip", [