D6535: strip: use bailifchanged() instead of reimplementing it

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Mon Jun 17 18:40:18 EDT 2019


Closed by commit rHG1474f5d84662: strip: use bailifchanged() instead of reimplementing it (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/D6535?vs=15549&id=15560

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

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

AFFECTED FILES
  hgext/strip.py
  tests/test-mq.t
  tests/test-strip.t

CHANGE DETAILS

diff --git a/tests/test-strip.t b/tests/test-strip.t
--- a/tests/test-strip.t
+++ b/tests/test-strip.t
@@ -551,7 +551,7 @@
 
   $ echo c > b
   $ hg strip tip
-  abort: local changes found
+  abort: uncommitted changes
   [255]
   $ hg strip tip --keep
   saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
@@ -703,7 +703,7 @@
   $ echo a > a
   $ hg add a
   $ hg strip -B B
-  abort: local changes found
+  abort: uncommitted changes
   [255]
   $ hg bookmarks
    * B                         6:ff43616e5d0f
diff --git a/tests/test-mq.t b/tests/test-mq.t
--- a/tests/test-mq.t
+++ b/tests/test-mq.t
@@ -811,7 +811,7 @@
   $ echo y>y
   $ hg add y
   $ hg strip tip
-  abort: local changes found
+  abort: uncommitted changes
   [255]
 
 --force strip with local changes
diff --git a/hgext/strip.py b/hgext/strip.py
--- a/hgext/strip.py
+++ b/hgext/strip.py
@@ -50,15 +50,7 @@
     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"))
-        if s.modified or s.added or s.removed or s.deleted:
-            _("local changes found") # i18n tool detection
-            raise error.Abort(_("local changes found"))
-        if checksubstate(repo):
-            _("local changed subrepos found") # i18n tool detection
-            raise error.Abort(_("local changed subrepos found"))
+        cmdutil.bailifchanged(repo)
     return s
 
 def _findupdatetarget(repo, nodes):



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


More information about the Mercurial-devel mailing list