diff --git a/hgext/purge.py b/hgext/purge.py --- a/hgext/purge.py +++ b/hgext/purge.py @@ -101,10 +101,12 @@ def purge(ui, repo, *dirs, **opts): status = repo.status(match=match, ignored=opts['all'], unknown=True) for f in sorted(status[4] + status[5]): - ui.note(_('removing file %s\n') % f) + if act: + ui.note(_('removing file %s\n') % f) remove(removefile, f) for f in sorted(directories, reverse=True): if match(f) and not os.listdir(repo.wjoin(f)): - ui.note(_('removing directory %s\n') % f) + if act: + ui.note(_('removing directory %s\n') % f) remove(os.rmdir, f) diff --git a/tests/test-purge.t b/tests/test-purge.t --- a/tests/test-purge.t +++ b/tests/test-purge.t @@ -21,7 +21,7 @@ setup delete an empty directory $ mkdir empty_dir - $ hg purge -p + $ hg purge -p -v empty_dir $ hg purge -v removing directory empty_dir