Commits

Pierre-Yves David committed 6c1fbef

prune: test and improve message of immutable aborting.

Comments (0)

Files changed (3)

         precs = []
         for p in sortedrevs(revs):
             cp = repo[p]
+            if not cp.mutable():
+                # note: create marker would had raise something anyway
+                raise util.Abort('cannot prune immutable changeset: %s' % cp,
+                                 hint='see "hg help phases" for details')
             precs.append(cp)
         if not precs:
             raise util.Abort('nothing to prune')
   $ hg log -r 1 --template '{rev} {phase} {obsolete}\n'
   1 public stable
   $ hg kill 1
-  abort: cannot obsolete immutable changeset: 7c3bad9141dc
+  abort: cannot prune immutable changeset: 7c3bad9141dc
+  (see "hg help phases" for details)
   [255]
   $ hg log -r 1 --template '{rev} {phase} {obsolete}\n'
   1 public stable
   4538525df7e2b9f09423636c61ef63a4cb872a2d 0 {'date': '*', 'user': 'test'} (glob)
   47d2a3944de8b013de3be9578e8e344ea2e6c097 0 {'date': '*', 'user': 'test'} (glob)
 
+cannot prune public changesets
+
+  $ hg prune 0
+  abort: cannot prune immutable changeset: 1f0dee641bb7
+  (see "hg help phases" for details)
+  [255]
+  $ hg debugobsolete
+  9d206ffc875e1bc304590549be293be36821e66c 0 {'date': '*', 'user': 'test'} (glob)
+  7c3bad9141dcb46ff89abf5f61856facd56e476c 0 {'date': '*', 'user': 'test'} (glob)
+  4538525df7e2b9f09423636c61ef63a4cb872a2d 0 {'date': '*', 'user': 'test'} (glob)
+  47d2a3944de8b013de3be9578e8e344ea2e6c097 0 {'date': '*', 'user': 'test'} (glob)
+
 Check successors addition
 ----------------------------