# HG changeset patch # User Matt Mackall # Date 2008-05-12 16:37:07 # Node ID 76af1dff402aebe1af9a7b864bd5d964e5f3d9f5 # Parent 44cd348e652949443cf33a2bbed3148192ceafe0 purge: use cmdutil.matchpats diff --git a/hgext/purge.py b/hgext/purge.py --- a/hgext/purge.py +++ b/hgext/purge.py @@ -27,7 +27,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -from mercurial import util, commands +from mercurial import util, commands, cmdutil from mercurial.i18n import _ import os @@ -63,8 +63,6 @@ def purge(ui, repo, *dirs, **opts): # --print0 implies --print act = False force = bool(opts['force']) - include = opts['include'] - exclude = opts['exclude'] def error(msg): if abort_on_err: @@ -87,8 +85,7 @@ def purge(ui, repo, *dirs, **opts): directories = [] files = [] missing = [] - roots, match, anypats = util.cmdmatcher(repo.root, repo.getcwd(), dirs, - include, exclude) + roots, match, anypats = cmdutil.matchpats(repo, dirs, opts) for src, f, st in repo.dirstate.statwalk(roots, match, ignored=ignored, directories=True): if src == 'd':