Comments
Patch
@@ -1944,6 +1944,14 @@
if not precs:
raise util.Abort('nothing to prune')
+ if not obsolete.isenabled(repo, obsolete.allowunstableopt):
+ repoheads = repo.changelog.headrevs()
+ pruneheads = repo.revs("heads(%ld)", precs)
+ # If a prune head is not a repo head then we will create
+ # unstability by operating on the midddle of the stack
+ if not all([h in repoheads for h in pruneheads]):
+ raise util.Abort(_("cannot prune in the middle of a stack"))
+
# defines successors changesets
sucs = scmutil.revrange(repo, succs)
sucs.sort()
@@ -1428,3 +1428,15 @@
|/
o 25:4c0bc042ef3b@default(draft) add j1
|
+
+Check that prune respects the allowunstable option
+ $ cat >> $HGRCPATH <<EOF
+ > [experimental]
+ > evolution=createmarkers
+ > evolutioncommands=^prune
+ > EOF
+ $ hg prune 2b5cbe59aeca
+ abort: cannot prune in the middle of a stack
+ [255]
+ $ hg prune 897e7966b9ef
+ 1 changesets pruned