Patchwork D6533: mq: remove dependency on strip's checklocalchanges()

login
register
mail settings
Submitter phabricator
Date June 17, 2019, 10:40 p.m.
Message ID <11f94aa869bbe9eff21891bb83d91a37@localhost.localdomain>
Download mbox | patch
Permalink /patch/40567/
State Not Applicable
Headers show

Comments

phabricator - June 17, 2019, 10:40 p.m.
Closed by commit rHGcf445a212b9c: mq: remove dependency on strip&#039;s checklocalchanges() (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6533?vs=15547&id=15558

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6533/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6533

AFFECTED FILES
  hgext/mq.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -145,8 +145,6 @@ 
 
 strip = stripext.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.
@@ -1149,7 +1147,20 @@ 
             # plain versions for i18n tool to detect them
             _("local changes found, qrefresh first")
             _("local changed subrepos found, qrefresh first")
-        return checklocalchanges(repo, force, excsuffix)
+
+        cmdutil.checkunfinished(repo)
+        s = repo.status()
+        if not force:
+            if len(repo[None].parents()) > 1:
+                _("outstanding uncommitted merge") #i18 tool detection
+                raise error.Abort(_("outstanding uncommitted merge"+ excsuffix))
+            if s.modified or s.added or s.removed or s.deleted:
+                _("local changes found") # i18n tool detection
+                raise error.Abort(_("local changes found" + excsuffix))
+            if checksubstate(repo):
+                _("local changed subrepos found") # i18n tool detection
+                raise error.Abort(_("local changed subrepos found" + excsuffix))
+        return s
 
     _reserved = ('series', 'status', 'guards', '.', '..')
     def checkreservedname(self, name):