view contrib/purge/README @ 4398:3b7e284b8f28

merge: expand and simplify the invalid handling for directory moves
author Matt Mackall <>
date Thu, 03 May 2007 17:24:43 -0500
parents dbeaa4369121
line wrap: on
line source

What is "hg purge"?
"purge" is a simple extension for the Mercurial source control management
system (
This extension adds a "purge" command to "hg" that removes files not known
to Mercurial, this is useful to test local and uncommitted changes in the
otherwise clean source tree.

This means that Mercurial will delete:
 - Unknown files: files marked with "?" by "hg status"
 - Ignored files: files usually ignored by Mercurial because they match a
   pattern in a ".hgignore" file
 - Empty directories: infact Mercurial ignores directories unless they
   contain files under source control managment
But it will leave untouched:
 - Unmodified files tracked by Mercurial
 - Modified files tracked by Mercurial
 - New files added to the repository (with "hg add")

Be careful with "hg purge", you could irreversibly delete some files you
forgot to add to the repository. If you only want to print the list of
files that this program would delete use:
  hg purge --print

To get the most recent version of "hg purge" visit its home page:

This program was inspired by the "cvspurge" script contained in CVS utilities

How to install
The purge extension is distributed with Mercurial, to activate it you need to
put these lines in your ~/.hgrc:


For more information on the configuration files see the man page for "hgrc":
  man 5 hgrc

How to use "hg purge"
For help on the usage of "hg purge" use:
  hg help purge

Copyright (C) 2006 - Marco Barisione <>

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.

A copy of the GNU General Public License is distributed along
with Mercurial in the file COPYING.