Mercurial > hg
diff tests/test-purge.t @ 46366:135056e8b5a8
purge: add a --confirm option
The options provide a prompt to the user before permanent deletion are made.
The prompt is currently not aware of directory deletion. I'll fix this in the
next changesets.
Differential Revision: https://phab.mercurial-scm.org/D9818
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 18 Jan 2021 10:24:03 +0100 |
parents | 5c2a4f37eace |
children | 57370e7deb7b |
line wrap: on
line diff
--- a/tests/test-purge.t Mon May 11 18:45:45 2020 -0400 +++ b/tests/test-purge.t Mon Jan 18 10:24:03 2021 +0100 @@ -62,6 +62,10 @@ $ hg purge -p untracked_file untracked_file_readonly + $ hg purge --confirm + permanently delete 2 unkown files? (yN) n + abort: removal cancelled + [250] $ hg purge -v removing file untracked_file removing file untracked_file_readonly @@ -121,6 +125,10 @@ $ cd directory $ hg purge -p ../untracked_directory untracked_directory/nested_directory + $ hg purge --confirm + permanently delete 1 unkown files? (yN) n + abort: removal cancelled + [250] $ hg purge -v ../untracked_directory removing directory untracked_directory/nested_directory removing directory untracked_directory @@ -138,6 +146,7 @@ $ touch ignored $ hg purge -p + $ hg purge --confirm $ hg purge -v $ touch untracked_file $ ls @@ -147,6 +156,10 @@ untracked_file $ hg purge -p -i ignored + $ hg purge --confirm -i + permanently delete 1 ignored files? (yN) n + abort: removal cancelled + [250] $ hg purge -v -i removing file ignored $ ls -A @@ -159,6 +172,10 @@ $ hg purge -p --all ignored untracked_file + $ hg purge --confirm --all + permanently delete 1 unkown and 1 ignored files? (yN) n + abort: removal cancelled + [250] $ hg purge -v --all removing file ignored removing file untracked_file