purge: use cmdutil.matchpats
authorMatt Mackall <mpm@selenic.com>
Mon, 12 May 2008 11:37:07 -0500
changeset 6574 76af1dff402a
parent 6573 44cd348e6529
child 6575 e08e0367ba15
purge: use cmdutil.matchpats
hgext/purge.py
--- a/hgext/purge.py	Mon May 12 11:37:07 2008 -0500
+++ b/hgext/purge.py	Mon May 12 11:37:07 2008 -0500
@@ -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 @@
         # --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 @@
     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':