hgext/strip.py
changeset 19824 237e40b2c1ff
parent 19823 6fb14d21fe9d
child 19825 4b4997068143
--- 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
+