contrib/purge/purge.py
changeset 4155 4c714ed245d6
parent 4154 15cd36db4230
child 4307 c8919eb0f315
--- a/contrib/purge/purge.py
+++ b/contrib/purge/purge.py
@@ -49,9 +49,10 @@ def dopurge(ui, repo, dirs=None, act=Tru
 
     directories = []
     files = []
-    for src, f, st in repo.dirstate.statwalk(files=dirs, ignored=True,
-                                             directories=True):
-        if   src == 'd':
+    roots, match, anypats = util.cmdmatcher(repo.root, repo.getcwd(), dirs)
+    for src, f, st in repo.dirstate.statwalk(files=roots, match=match,
+                                             ignored=True, directories=True):
+        if src == 'd':
             directories.append(f)
         elif src == 'f' and f not in repo.dirstate:
             files.append(f)