hgext/mq.py
changeset 19814 4495c6a272e0
parent 19813 76796fe65bad
child 19815 378567bf9f74
--- 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",
          [