D6529: strip: during merge allow strip only when -f is used

taapas1128 (Taapas Agrawal) phabricator at mercurial-scm.org
Fri Jun 14 11:22:32 EDT 2019


Closed by commit rHG1acaa9f37377: strip: during merge allow strip only when -f is used (authored by taapas1128).
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/D6529?vs=15511&id=15512

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

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

AFFECTED FILES
  hgext/strip.py
  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
@@ -272,7 +272,12 @@
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     c
   
+##strip not allowed with merge in progress
   $ hg strip 4
+  abort: outstanding uncommitted merge
+  [255]
+##strip allowed --force with merge in progress
+  $ hg strip 4 --force
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
 
diff --git a/hgext/strip.py b/hgext/strip.py
--- a/hgext/strip.py
+++ b/hgext/strip.py
@@ -50,6 +50,9 @@
     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))



To: taapas1128, #hg-reviewers, pulkit
Cc: pulkit, mercurial-devel


More information about the Mercurial-devel mailing list