Mercurial > public > mercurial-scm > hg
diff mercurial/merge.py @ 44289:9f8eddd2723f
purge: add -i flag to delete ignored files instead of untracked files
It's convenient for deleting build artifacts. Using --all instead
would delete other things too.
Differential Revision: https://phab.mercurial-scm.org/D8096
author | Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> |
---|---|
date | Sat, 08 Feb 2020 10:22:47 -0500 |
parents | e76d98546bd2 |
children | 218feb1a7e00 |
line wrap: on
line diff
--- a/mercurial/merge.py Thu Jan 30 19:50:43 2020 -0500 +++ b/mercurial/merge.py Sat Feb 08 10:22:47 2020 -0500 @@ -2698,6 +2698,7 @@ def purge( repo, matcher, + unknown=True, ignored=False, removeemptydirs=True, removefiles=True, @@ -2709,7 +2710,9 @@ ``matcher`` is a matcher configured to scan the working directory - potentially a subset. - ``ignored`` controls whether ignored files should also be purged. + ``unknown`` controls whether unknown files should be purged. + + ``ignored`` controls whether ignored files should be purged. ``removeemptydirs`` controls whether empty directories should be removed. @@ -2746,7 +2749,7 @@ directories = [] matcher.traversedir = directories.append - status = repo.status(match=matcher, ignored=ignored, unknown=True) + status = repo.status(match=matcher, ignored=ignored, unknown=unknown) if removefiles: for f in sorted(status.unknown + status.ignored):