Purge extension

This extension is currently being distributed along with Mercurial.

Author: Marco Barisione


This extension purges all files and directories not being tracked by Mercurial in the current repository.

It'll remove unknown files and empty directories by default. With the --all option, it will also remove ignored files.

It keeps added files and (unmodified or modified) tracked files.


Just add a new entry in the extensions section of the mercurial configuration file (hgrc):

purge =
#or, if purge.py not in the hgext dir:
#purge =/path/to/purge.py


To purge the repository contents:

hg purge

To list the files that would be removed by running the previous command use it with the --print option:

hg purge --print


PurgeExtension (last edited 2014-03-18 16:45:50 by PhilipJagielski)