diff tests/test-purge.t @ 46368:bb3a5c0df06b

purge: move extension into core mercurial The motivation is simple: it's nicer to avoid gating basic functionality. To reduce the risk of people shooting themselves in the feet, `--confirm` is now the default, unless the extensions is loaded.. For review of the body of the purge command, use this instead of what hg/phabricator will show (the block of code is modified, not just moved): Differential Revision: https://phab.mercurial-scm.org/D9820
author Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
date Mon, 18 Jan 2021 10:24:20 +0100
parents 57370e7deb7b
children 93eb6c8035a9
line wrap: on
line diff
--- a/tests/test-purge.t	Mon Jan 18 10:24:11 2021 +0100
+++ b/tests/test-purge.t	Mon Jan 18 10:24:20 2021 +0100
@@ -1,8 +1,3 @@
-  $ cat <<EOF >> $HGRCPATH
-  > [extensions]
-  > purge =
-  > EOF
-
 init
 
   $ hg init t
@@ -18,6 +13,26 @@
   $ echo 'ignored' > .hgignore
   $ hg ci -qAmr3 -d'2 0'
 
+purge without the extension
+
+  $ hg st
+  $ touch foo
+  $ hg purge
+  permanently delete 1 unkown files? (yN) n
+  abort: removal cancelled
+  [250]
+  $ hg st
+  ? foo
+  $ hg purge --no-confirm
+  $ hg st
+
+now enabling the extension
+
+  $ cat <<EOF >> $HGRCPATH
+  > [extensions]
+  > purge =
+  > EOF
+
 delete an empty directory
 
   $ mkdir empty_dir