tests/test-purge.t
changeset 44724 5c2a4f37eace
parent 44335 9f8eddd2723f
child 46438 135056e8b5a8
equal deleted inserted replaced
44723:28aacddf3af0 44724:5c2a4f37eace
    23   $ mkdir empty_dir
    23   $ mkdir empty_dir
    24   $ hg purge -p -v
    24   $ hg purge -p -v
    25   empty_dir
    25   empty_dir
    26   $ hg purge -v
    26   $ hg purge -v
    27   removing directory empty_dir
    27   removing directory empty_dir
    28   $ ls
    28   $ ls -A
       
    29   .hg
       
    30   .hgignore
    29   directory
    31   directory
    30   r1
    32   r1
    31 
    33 
    32 delete an untracked directory
    34 delete an untracked directory
    33 
    35 
    39   untracked_dir/untracked_file2
    41   untracked_dir/untracked_file2
    40   $ hg purge -v
    42   $ hg purge -v
    41   removing file untracked_dir/untracked_file1
    43   removing file untracked_dir/untracked_file1
    42   removing file untracked_dir/untracked_file2
    44   removing file untracked_dir/untracked_file2
    43   removing directory untracked_dir
    45   removing directory untracked_dir
    44   $ ls
    46   $ ls -A
       
    47   .hg
       
    48   .hgignore
    45   directory
    49   directory
    46   r1
    50   r1
    47 
    51 
    48 delete an untracked file
    52 delete an untracked file
    49 
    53 
    59   untracked_file
    63   untracked_file
    60   untracked_file_readonly
    64   untracked_file_readonly
    61   $ hg purge -v
    65   $ hg purge -v
    62   removing file untracked_file
    66   removing file untracked_file
    63   removing file untracked_file_readonly
    67   removing file untracked_file_readonly
    64   $ ls
    68   $ ls -A
       
    69   .hg
       
    70   .hgignore
    65   directory
    71   directory
    66   r1
    72   r1
    67 
    73 
    68 delete an untracked file in a tracked directory
    74 delete an untracked file in a tracked directory
    69 
    75 
    70   $ touch directory/untracked_file
    76   $ touch directory/untracked_file
    71   $ hg purge -p
    77   $ hg purge -p
    72   directory/untracked_file
    78   directory/untracked_file
    73   $ hg purge -v
    79   $ hg purge -v
    74   removing file directory/untracked_file
    80   removing file directory/untracked_file
    75   $ ls
    81   $ ls -A
       
    82   .hg
       
    83   .hgignore
    76   directory
    84   directory
    77   r1
    85   r1
    78 
    86 
    79 delete nested directories
    87 delete nested directories
    80 
    88 
    82   $ hg purge -p
    90   $ hg purge -p
    83   untracked_directory/nested_directory
    91   untracked_directory/nested_directory
    84   $ hg purge -v
    92   $ hg purge -v
    85   removing directory untracked_directory/nested_directory
    93   removing directory untracked_directory/nested_directory
    86   removing directory untracked_directory
    94   removing directory untracked_directory
    87   $ ls
    95   $ ls -A
       
    96   .hg
       
    97   .hgignore
    88   directory
    98   directory
    89   r1
    99   r1
    90 
   100 
    91 delete nested directories from a subdir
   101 delete nested directories from a subdir
    92 
   102 
    96   untracked_directory/nested_directory
   106   untracked_directory/nested_directory
    97   $ hg purge -v
   107   $ hg purge -v
    98   removing directory untracked_directory/nested_directory
   108   removing directory untracked_directory/nested_directory
    99   removing directory untracked_directory
   109   removing directory untracked_directory
   100   $ cd ..
   110   $ cd ..
   101   $ ls
   111   $ ls -A
       
   112   .hg
       
   113   .hgignore
   102   directory
   114   directory
   103   r1
   115   r1
   104 
   116 
   105 delete only part of the tree
   117 delete only part of the tree
   106 
   118 
   111   untracked_directory/nested_directory
   123   untracked_directory/nested_directory
   112   $ hg purge -v ../untracked_directory
   124   $ hg purge -v ../untracked_directory
   113   removing directory untracked_directory/nested_directory
   125   removing directory untracked_directory/nested_directory
   114   removing directory untracked_directory
   126   removing directory untracked_directory
   115   $ cd ..
   127   $ cd ..
   116   $ ls
   128   $ ls -A
       
   129   .hg
       
   130   .hgignore
   117   directory
   131   directory
   118   r1
   132   r1
   119   $ ls directory/untracked_file
   133   $ ls directory/untracked_file
   120   directory/untracked_file
   134   directory/untracked_file
   121   $ rm directory/untracked_file
   135   $ rm directory/untracked_file
   133   untracked_file
   147   untracked_file
   134   $ hg purge -p -i
   148   $ hg purge -p -i
   135   ignored
   149   ignored
   136   $ hg purge -v -i
   150   $ hg purge -v -i
   137   removing file ignored
   151   removing file ignored
   138   $ ls
   152   $ ls -A
       
   153   .hg
       
   154   .hgignore
   139   directory
   155   directory
   140   r1
   156   r1
   141   untracked_file
   157   untracked_file
   142   $ touch ignored
   158   $ touch ignored
   143   $ hg purge -p --all
   159   $ hg purge -p --all
   187 skip excluded files
   203 skip excluded files
   188 
   204 
   189   $ touch excluded_file
   205   $ touch excluded_file
   190   $ hg purge -p -X excluded_file
   206   $ hg purge -p -X excluded_file
   191   $ hg purge -v -X excluded_file
   207   $ hg purge -v -X excluded_file
   192   $ ls
   208   $ ls -A
       
   209   .hg
       
   210   .hgignore
   193   directory
   211   directory
   194   excluded_file
   212   excluded_file
   195   r1
   213   r1
   196   $ rm excluded_file
   214   $ rm excluded_file
   197 
   215 
   199 
   217 
   200   $ mkdir excluded_dir
   218   $ mkdir excluded_dir
   201   $ touch excluded_dir/file
   219   $ touch excluded_dir/file
   202   $ hg purge -p -X excluded_dir
   220   $ hg purge -p -X excluded_dir
   203   $ hg purge -v -X excluded_dir
   221   $ hg purge -v -X excluded_dir
   204   $ ls
   222   $ ls -A
       
   223   .hg
       
   224   .hgignore
   205   directory
   225   directory
   206   excluded_dir
   226   excluded_dir
   207   r1
   227   r1
   208   $ ls excluded_dir
   228   $ ls excluded_dir
   209   file
   229   file
   212 skip excluded empty dirs
   232 skip excluded empty dirs
   213 
   233 
   214   $ mkdir excluded_dir
   234   $ mkdir excluded_dir
   215   $ hg purge -p -X excluded_dir
   235   $ hg purge -p -X excluded_dir
   216   $ hg purge -v -X excluded_dir
   236   $ hg purge -v -X excluded_dir
   217   $ ls
   237   $ ls -A
       
   238   .hg
       
   239   .hgignore
   218   directory
   240   directory
   219   excluded_dir
   241   excluded_dir
   220   r1
   242   r1
   221   $ rmdir excluded_dir
   243   $ rmdir excluded_dir
   222 
   244 
   239   dir/untracked_file
   261   dir/untracked_file
   240   untracked_file
   262   untracked_file
   241   $ hg purge -v --files
   263   $ hg purge -v --files
   242   removing file dir/untracked_file
   264   removing file dir/untracked_file
   243   removing file untracked_file
   265   removing file untracked_file
   244   $ ls
   266   $ ls -A
       
   267   .hg
       
   268   .hgignore
   245   dir
   269   dir
   246   empty_dir
   270   empty_dir
   247   $ ls dir
   271   $ ls dir
   248 
   272 
   249 only remove dirs
   273 only remove dirs
   252   $ touch untracked_file dir/untracked_file
   276   $ touch untracked_file dir/untracked_file
   253   $ hg purge -p --dirs
   277   $ hg purge -p --dirs
   254   empty_dir
   278   empty_dir
   255   $ hg purge -v --dirs
   279   $ hg purge -v --dirs
   256   removing directory empty_dir
   280   removing directory empty_dir
   257   $ ls
   281   $ ls -A
       
   282   .hg
       
   283   .hgignore
   258   dir
   284   dir
   259   untracked_file
   285   untracked_file
   260   $ ls dir
   286   $ ls dir
   261   untracked_file
   287   untracked_file
   262 
   288 
   271   $ hg purge -v --files --dirs
   297   $ hg purge -v --files --dirs
   272   removing file dir/untracked_file
   298   removing file dir/untracked_file
   273   removing file untracked_file
   299   removing file untracked_file
   274   removing directory empty_dir
   300   removing directory empty_dir
   275   removing directory dir
   301   removing directory dir
   276   $ ls
   302   $ ls -A
       
   303   .hg
       
   304   .hgignore
   277 
   305 
   278   $ cd ..
   306   $ cd ..