This extension allows you to strip changesets and all their descendants from the repository. See the command help for details.



strip changesets and all their descendants from the repository:

hg strip [-k] [-f] [-B bookmark] [-r] REV...

The strip command removes the specified changesets and all their descendants. If the working directory has uncommitted changes, the operation is aborted unless the --force flag is supplied, in which case changes will be discarded.

If a parent of the working directory is stripped, then the working directory will automatically be updated to the most recent available ancestor of the stripped parent after the operation completes.

Any stripped changesets are stored in .hg/strip-backup as a bundle (see hg help bundle and hg help unbundle). They can be restored by running hg unbundle .hg/strip-backup/BUNDLE, where BUNDLE is the bundle file created by the strip. Note that the local revision numbers will in general be different after the restore.

Use the --no-backup option to discard the backup bundle once the operation completes.

Strip is not a history-rewriting operation and can be used on changesets in the public phase. But if the stripped changesets have been pushed to a remote repository you will likely pull them again.

Return 0 on success.


-r, --rev <REV[+]>
 strip specified revision (optional, can specify revisions without this option)
-f, --force force removal of changesets, discard uncommitted changes (no backup)
--no-backup do not save backup bundle
--nobackup do not save backup bundle (DEPRECATED)
-n ignored (DEPRECATED)
-k, --keep do not modify working directory during strip
-B, --bookmark <BOOKMARK[+]>
 remove revs only reachable from given bookmark

[+] marked option can be specified multiple times