diff tests/test-sparse.t @ 48737:a6efb9180764

sparse: rework debugsparse's interface hg debugsparse supports arguments like --include, similar to `hg tracked --addinclude` or `hg log --include`. But in `hg debugsparse`, the pattern is not an argument of the flag, instead the patterns are the anonymous command line arguments. Not only is this surprising, it makes it impossible to use --include and --exclude in the same invocation, or --reset --exclude. So I propose making debugsparse making --include, --exclude take an argument, and rejecting anonymous command line arguments, as well as allowing mixing several of these flags in one invocations. Differential Revision: https://phab.mercurial-scm.org/D12155
author Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
date Mon, 07 Feb 2022 00:33:22 -0500
parents a51c522c0064
children 7e5be4a7cda7
line wrap: on
line diff
--- a/tests/test-sparse.t	Wed Feb 09 13:04:37 2022 -0500
+++ b/tests/test-sparse.t	Mon Feb 07 00:33:22 2022 -0500
@@ -147,7 +147,7 @@
 
 Verify deleting sparseness with --force brings back files
 
-  $ hg debugsparse --delete -f 'show*'
+  $ hg debugsparse -f --delete 'show*'
   pending changes to 'hide'
   $ ls -A
   .hg
@@ -170,7 +170,7 @@
 
 Verify adding sparseness hides files
 
-  $ hg debugsparse --exclude -f 'hide*'
+  $ hg debugsparse -f --exclude 'hide*'
   pending changes to 'hide'
   $ ls -A
   .hg
@@ -254,6 +254,15 @@
   hide*
   
 
+Multiple -I and -X can be passed at once
+
+  $ hg debugsparse --reset -I '*2' -X 'hide2'
+  $ ls -A
+  .hg
+  hide.orig
+  show2
+  $ hg debugsparse --reset -X 'hide*'
+
 Verify strip -k resets dirstate correctly
 
   $ hg status