Skip to content
Snippets Groups Projects
Commit 1acaa9f37377 authored by Taapas Agrawal's avatar Taapas Agrawal
Browse files

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

This ensures to abort strip to `hg strip` when we have a merge
in progress and allow it only when a `--force` flag is used.

Differential Revision: https://phab.mercurial-scm.org/D6529
parent 4a3abb33380a
No related branches found
No related tags found
No related merge requests found
......@@ -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))
......
......@@ -272,4 +272,5 @@
date: Thu Jan 01 00:00:00 1970 +0000
summary: c
##strip not allowed with merge in progress
$ hg strip 4
......@@ -275,4 +276,8 @@
$ 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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment