obliterate functionality?

Marcin Kasperski Marcin.Kasperski at softax.com.pl
Wed Mar 19 08:12:23 CDT 2008

Martin Geisler <mg at daimi.au.dk> writes:

> cowwoc <cowwoc at bbs.darktech.org> writes:
> Hello
>> How does one permanently remove a file in Mercurial (aka
>> "obliterate")? CVS had this, SVN does not and I'm wondering how
>> Mercurial stacks up.
> As others have told you, then this is not possible if other people have
> already pulled from the repository -- they now have their own copy of
> the data you want to delete, and there is nothing you can do to make
> them delete it!

In many cases it would suffice if just

a) future clones won't get the copy (if pulled from mine repo)

b) I wouldn't get the copy back if I pulled from somebody who cloned earlier

c) those earlier clones were advised to obliterate in a way or another

> If tip is revision 100, and you wish to edit revision 90, and there is a
> linear history from 90-100, then this is what you do:
>   # Change permanent changesets into editable patches
>   hg qimport -r 90:100
>   # Make the desired patch the top patch
>   hg qpop 90.diff
>   # Edit files, remove the passwords, etc...
>   # Look at your changes against the original patch
>   hg diff
>   # Look at your changes against the previous revision
>   hg qdiff
>   # When satisfied, store the edits in the patch
>   hg qrefresh
>   # Apply all patches
>   hg qpush -a
>   # Change patches into changesets
>   hg qdelete -r qbase:qtip

Worth documenting on the wiki and explaining. And a bit too painful...
(it may be caused by imperfect naming or so - like "delete" used to
commit and "import" to remove changesets, but many people find those
ops to be confusing

More information about the Mercurial mailing list