# HG changeset patch # User Pierre-Yves David # Date 1380231172 -7200 # Node ID 237e40b2c1ffb70f372b5bd3288d926d823a1e8f # Parent 6fb14d21fe9d9be30f71efc9cf5a5f1995082678 strip: move checklocalchanges from mq to strip One more step for issue3824. diff -r 6fb14d21fe9d -r 237e40b2c1ff hgext/mq.py --- a/hgext/mq.py Thu Sep 26 23:12:43 2013 +0200 +++ b/hgext/mq.py Thu Sep 26 23:32:52 2013 +0200 @@ -89,6 +89,8 @@ stripext = extensions.load(dummyui(), 'strip', '') checksubstate = stripext.checksubstate +checklocalchanges = stripext.checklocalchanges + # Patch names looks like unix-file names. # They must be joinable with queue directory and result in the patch path. @@ -2909,18 +2911,6 @@ q.savedirty() return 0 -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 - def strip(ui, repo, revs, update=True, backup="all", force=None): wlock = lock = None try: diff -r 6fb14d21fe9d -r 237e40b2c1ff hgext/strip.py --- a/hgext/strip.py Thu Sep 26 23:12:43 2013 +0200 +++ b/hgext/strip.py Thu Sep 26 23:32:52 2013 +0200 @@ -22,3 +22,15 @@ 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 +