tests/test-remove.t
changeset 28608 62e73d42bd14
parent 28607 a88959ae5938
child 28889 7a1e0711401e
equal deleted inserted replaced
28607:a88959ae5938 28608:62e73d42bd14
    24   $ echo a > foo
    24   $ echo a > foo
    25 
    25 
    26 file not managed
    26 file not managed
    27 
    27 
    28   $ remove foo
    28   $ remove foo
       
    29   \r (no-eol) (esc)
       
    30   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
    31                                                               \r (no-eol) (esc)
    29   not removing foo: file is untracked
    32   not removing foo: file is untracked
    30   exit code: 1
    33   exit code: 1
    31   ? foo
    34   ? foo
    32   ./foo
    35   ./foo
    33   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
    36   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
    39 00 state added, options none
    42 00 state added, options none
    40 
    43 
    41   $ echo b > bar
    44   $ echo b > bar
    42   $ hg add bar
    45   $ hg add bar
    43   $ remove bar
    46   $ remove bar
       
    47   \r (no-eol) (esc)
       
    48   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
    49                                                               \r (no-eol) (esc)
       
    50   \r (no-eol) (esc)
       
    51   skipping [===========================================>] 1/1\r (no-eol) (esc)
       
    52                                                               \r (no-eol) (esc)
    44   not removing bar: file has been marked for add (use forget to undo)
    53   not removing bar: file has been marked for add (use forget to undo)
    45   exit code: 1
    54   exit code: 1
    46   A bar
    55   A bar
    47   ./bar
    56   ./bar
    48   ./foo
    57   ./foo
    52   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
    61   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
    53 
    62 
    54 01 state clean, options none
    63 01 state clean, options none
    55 
    64 
    56   $ remove foo
    65   $ remove foo
       
    66   \r (no-eol) (esc)
       
    67   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
    68                                                               \r (no-eol) (esc)
    57   exit code: 0
    69   exit code: 0
    58   R foo
    70   R foo
    59   ? bar
    71   ? bar
    60   ./bar
    72   ./bar
    61   \r (no-eol) (esc)
    73   \r (no-eol) (esc)
    65 
    77 
    66 02 state modified, options none
    78 02 state modified, options none
    67 
    79 
    68   $ echo b >> foo
    80   $ echo b >> foo
    69   $ remove foo
    81   $ remove foo
       
    82   \r (no-eol) (esc)
       
    83   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
    84                                                               \r (no-eol) (esc)
       
    85   \r (no-eol) (esc)
       
    86   skipping [===========================================>] 1/1\r (no-eol) (esc)
       
    87                                                               \r (no-eol) (esc)
    70   not removing foo: file is modified (use -f to force removal)
    88   not removing foo: file is modified (use -f to force removal)
    71   exit code: 1
    89   exit code: 1
    72   M foo
    90   M foo
    73   ? bar
    91   ? bar
    74   ./bar
    92   ./bar
    80 
    98 
    81 03 state missing, options none
    99 03 state missing, options none
    82 
   100 
    83   $ rm foo
   101   $ rm foo
    84   $ remove foo
   102   $ remove foo
       
   103   \r (no-eol) (esc)
       
   104   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
   105                                                               \r (no-eol) (esc)
    85   exit code: 0
   106   exit code: 0
    86   R foo
   107   R foo
    87   ? bar
   108   ? bar
    88   ./bar
   109   ./bar
    89   \r (no-eol) (esc)
   110   \r (no-eol) (esc)
    94 10 state added, options -f
   115 10 state added, options -f
    95 
   116 
    96   $ echo b > bar
   117   $ echo b > bar
    97   $ hg add bar
   118   $ hg add bar
    98   $ remove -f bar
   119   $ remove -f bar
       
   120   \r (no-eol) (esc)
       
   121   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
   122                                                               \r (no-eol) (esc)
    99   exit code: 0
   123   exit code: 0
   100   ? bar
   124   ? bar
   101   ./bar
   125   ./bar
   102   ./foo
   126   ./foo
   103   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   127   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   104   $ rm bar
   128   $ rm bar
   105 
   129 
   106 11 state clean, options -f
   130 11 state clean, options -f
   107 
   131 
   108   $ remove -f foo
   132   $ remove -f foo
       
   133   \r (no-eol) (esc)
       
   134   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
   135                                                               \r (no-eol) (esc)
   109   exit code: 0
   136   exit code: 0
   110   R foo
   137   R foo
   111   \r (no-eol) (esc)
   138   \r (no-eol) (esc)
   112   updating [===========================================>] 1/1\r (no-eol) (esc)
   139   updating [===========================================>] 1/1\r (no-eol) (esc)
   113                                                               \r (no-eol) (esc)
   140                                                               \r (no-eol) (esc)
   115 
   142 
   116 12 state modified, options -f
   143 12 state modified, options -f
   117 
   144 
   118   $ echo b >> foo
   145   $ echo b >> foo
   119   $ remove -f foo
   146   $ remove -f foo
       
   147   \r (no-eol) (esc)
       
   148   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
   149                                                               \r (no-eol) (esc)
   120   exit code: 0
   150   exit code: 0
   121   R foo
   151   R foo
   122   \r (no-eol) (esc)
   152   \r (no-eol) (esc)
   123   updating [===========================================>] 1/1\r (no-eol) (esc)
   153   updating [===========================================>] 1/1\r (no-eol) (esc)
   124                                                               \r (no-eol) (esc)
   154                                                               \r (no-eol) (esc)
   126 
   156 
   127 13 state missing, options -f
   157 13 state missing, options -f
   128 
   158 
   129   $ rm foo
   159   $ rm foo
   130   $ remove -f foo
   160   $ remove -f foo
       
   161   \r (no-eol) (esc)
       
   162   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
   163                                                               \r (no-eol) (esc)
   131   exit code: 0
   164   exit code: 0
   132   R foo
   165   R foo
   133   \r (no-eol) (esc)
   166   \r (no-eol) (esc)
   134   updating [===========================================>] 1/1\r (no-eol) (esc)
   167   updating [===========================================>] 1/1\r (no-eol) (esc)
   135                                                               \r (no-eol) (esc)
   168                                                               \r (no-eol) (esc)
   138 20 state added, options -A
   171 20 state added, options -A
   139 
   172 
   140   $ echo b > bar
   173   $ echo b > bar
   141   $ hg add bar
   174   $ hg add bar
   142   $ remove -A bar
   175   $ remove -A bar
       
   176   \r (no-eol) (esc)
       
   177   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
   178                                                               \r (no-eol) (esc)
       
   179   \r (no-eol) (esc)
       
   180   skipping [===========================================>] 1/1\r (no-eol) (esc)
       
   181                                                               \r (no-eol) (esc)
   143   not removing bar: file still exists
   182   not removing bar: file still exists
   144   exit code: 1
   183   exit code: 1
   145   A bar
   184   A bar
   146   ./bar
   185   ./bar
   147   ./foo
   186   ./foo
   151   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   190   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   152 
   191 
   153 21 state clean, options -A
   192 21 state clean, options -A
   154 
   193 
   155   $ remove -A foo
   194   $ remove -A foo
       
   195   \r (no-eol) (esc)
       
   196   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
   197                                                               \r (no-eol) (esc)
       
   198   \r (no-eol) (esc)
       
   199   skipping [===========================================>] 1/1\r (no-eol) (esc)
       
   200                                                               \r (no-eol) (esc)
   156   not removing foo: file still exists
   201   not removing foo: file still exists
   157   exit code: 1
   202   exit code: 1
   158   ? bar
   203   ? bar
   159   ./bar
   204   ./bar
   160   ./foo
   205   ./foo
   162 
   207 
   163 22 state modified, options -A
   208 22 state modified, options -A
   164 
   209 
   165   $ echo b >> foo
   210   $ echo b >> foo
   166   $ remove -A foo
   211   $ remove -A foo
       
   212   \r (no-eol) (esc)
       
   213   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
   214                                                               \r (no-eol) (esc)
       
   215   \r (no-eol) (esc)
       
   216   skipping [===========================================>] 1/1\r (no-eol) (esc)
       
   217                                                               \r (no-eol) (esc)
   167   not removing foo: file still exists
   218   not removing foo: file still exists
   168   exit code: 1
   219   exit code: 1
   169   M foo
   220   M foo
   170   ? bar
   221   ? bar
   171   ./bar
   222   ./bar
   177 
   228 
   178 23 state missing, options -A
   229 23 state missing, options -A
   179 
   230 
   180   $ rm foo
   231   $ rm foo
   181   $ remove -A foo
   232   $ remove -A foo
       
   233   \r (no-eol) (esc)
       
   234   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
   235                                                               \r (no-eol) (esc)
   182   exit code: 0
   236   exit code: 0
   183   R foo
   237   R foo
   184   ? bar
   238   ? bar
   185   ./bar
   239   ./bar
   186   \r (no-eol) (esc)
   240   \r (no-eol) (esc)
   191 30 state added, options -Af
   245 30 state added, options -Af
   192 
   246 
   193   $ echo b > bar
   247   $ echo b > bar
   194   $ hg add bar
   248   $ hg add bar
   195   $ remove -Af bar
   249   $ remove -Af bar
       
   250   \r (no-eol) (esc)
       
   251   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
   252                                                               \r (no-eol) (esc)
   196   exit code: 0
   253   exit code: 0
   197   ? bar
   254   ? bar
   198   ./bar
   255   ./bar
   199   ./foo
   256   ./foo
   200   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   257   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   201   $ rm bar
   258   $ rm bar
   202 
   259 
   203 31 state clean, options -Af
   260 31 state clean, options -Af
   204 
   261 
   205   $ remove -Af foo
   262   $ remove -Af foo
       
   263   \r (no-eol) (esc)
       
   264   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
   265                                                               \r (no-eol) (esc)
   206   exit code: 0
   266   exit code: 0
   207   R foo
   267   R foo
   208   ./foo
   268   ./foo
   209   \r (no-eol) (esc)
   269   \r (no-eol) (esc)
   210   updating [===========================================>] 1/1\r (no-eol) (esc)
   270   updating [===========================================>] 1/1\r (no-eol) (esc)
   213 
   273 
   214 32 state modified, options -Af
   274 32 state modified, options -Af
   215 
   275 
   216   $ echo b >> foo
   276   $ echo b >> foo
   217   $ remove -Af foo
   277   $ remove -Af foo
       
   278   \r (no-eol) (esc)
       
   279   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
   280                                                               \r (no-eol) (esc)
   218   exit code: 0
   281   exit code: 0
   219   R foo
   282   R foo
   220   ./foo
   283   ./foo
   221   \r (no-eol) (esc)
   284   \r (no-eol) (esc)
   222   updating [===========================================>] 1/1\r (no-eol) (esc)
   285   updating [===========================================>] 1/1\r (no-eol) (esc)
   225 
   288 
   226 33 state missing, options -Af
   289 33 state missing, options -Af
   227 
   290 
   228   $ rm foo
   291   $ rm foo
   229   $ remove -Af foo
   292   $ remove -Af foo
       
   293   \r (no-eol) (esc)
       
   294   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
   295                                                               \r (no-eol) (esc)
   230   exit code: 0
   296   exit code: 0
   231   R foo
   297   R foo
   232   \r (no-eol) (esc)
   298   \r (no-eol) (esc)
   233   updating [===========================================>] 1/1\r (no-eol) (esc)
   299   updating [===========================================>] 1/1\r (no-eol) (esc)
   234                                                               \r (no-eol) (esc)
   300                                                               \r (no-eol) (esc)
   245 
   311 
   246 dir, options none
   312 dir, options none
   247 
   313 
   248   $ rm test/bar
   314   $ rm test/bar
   249   $ remove test
   315   $ remove test
       
   316   \r (no-eol) (esc)
       
   317   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
   318                                                               \r (no-eol) (esc)
       
   319   \r (no-eol) (esc)
       
   320   deleting [=====================>                      ] 1/2\r (no-eol) (esc)
       
   321                                                               \r (no-eol) (esc)
       
   322   \r (no-eol) (esc)
       
   323   deleting [===========================================>] 2/2\r (no-eol) (esc)
       
   324                                                               \r (no-eol) (esc)
       
   325   \r (no-eol) (esc)
       
   326                                                               \r (no-eol) (esc)
   250   removing test/bar (glob)
   327   removing test/bar (glob)
   251   removing test/foo (glob)
   328   removing test/foo (glob)
   252   exit code: 0
   329   exit code: 0
   253   R test/bar
   330   R test/bar
   254   R test/foo
   331   R test/foo
   260 
   337 
   261 dir, options -f
   338 dir, options -f
   262 
   339 
   263   $ rm test/bar
   340   $ rm test/bar
   264   $ remove -f test
   341   $ remove -f test
       
   342   \r (no-eol) (esc)
       
   343   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
   344                                                               \r (no-eol) (esc)
       
   345   \r (no-eol) (esc)
       
   346   deleting [=====================>                      ] 1/2\r (no-eol) (esc)
       
   347                                                               \r (no-eol) (esc)
       
   348   \r (no-eol) (esc)
       
   349   deleting [===========================================>] 2/2\r (no-eol) (esc)
       
   350                                                               \r (no-eol) (esc)
       
   351   \r (no-eol) (esc)
       
   352                                                               \r (no-eol) (esc)
   265   removing test/bar (glob)
   353   removing test/bar (glob)
   266   removing test/foo (glob)
   354   removing test/foo (glob)
   267   exit code: 0
   355   exit code: 0
   268   R test/bar
   356   R test/bar
   269   R test/foo
   357   R test/foo
   275 
   363 
   276 dir, options -A
   364 dir, options -A
   277 
   365 
   278   $ rm test/bar
   366   $ rm test/bar
   279   $ remove -A test
   367   $ remove -A test
       
   368   \r (no-eol) (esc)
       
   369   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
   370                                                               \r (no-eol) (esc)
       
   371   \r (no-eol) (esc)
       
   372   skipping [===========================================>] 1/1\r (no-eol) (esc)
       
   373                                                               \r (no-eol) (esc)
       
   374   \r (no-eol) (esc)
       
   375   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
   376                                                               \r (no-eol) (esc)
       
   377   \r (no-eol) (esc)
       
   378                                                               \r (no-eol) (esc)
   280   removing test/bar (glob)
   379   removing test/bar (glob)
   281   not removing test/foo: file still exists (glob)
   380   not removing test/foo: file still exists (glob)
   282   exit code: 1
   381   exit code: 1
   283   R test/bar
   382   R test/bar
   284   ./foo
   383   ./foo
   290 
   389 
   291 dir, options -Af
   390 dir, options -Af
   292 
   391 
   293   $ rm test/bar
   392   $ rm test/bar
   294   $ remove -Af test
   393   $ remove -Af test
       
   394   \r (no-eol) (esc)
       
   395   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
   396                                                               \r (no-eol) (esc)
       
   397   \r (no-eol) (esc)
       
   398   deleting [=====================>                      ] 1/2\r (no-eol) (esc)
       
   399                                                               \r (no-eol) (esc)
       
   400   \r (no-eol) (esc)
       
   401   deleting [===========================================>] 2/2\r (no-eol) (esc)
       
   402                                                               \r (no-eol) (esc)
       
   403   \r (no-eol) (esc)
       
   404                                                               \r (no-eol) (esc)
   295   removing test/bar (glob)
   405   removing test/bar (glob)
   296   removing test/foo (glob)
   406   removing test/foo (glob)
   297   exit code: 0
   407   exit code: 0
   298   R test/bar
   408   R test/bar
   299   R test/foo
   409   R test/foo
   311   $ echo y > issue1861/b/c/y
   421   $ echo y > issue1861/b/c/y
   312   $ hg ci -Am add
   422   $ hg ci -Am add
   313   adding issue1861/b/c/y
   423   adding issue1861/b/c/y
   314   adding issue1861/x
   424   adding issue1861/x
   315   $ hg rm issue1861/b
   425   $ hg rm issue1861/b
       
   426   \r (no-eol) (esc)
       
   427   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
   428                                                               \r (no-eol) (esc)
       
   429   \r (no-eol) (esc)
       
   430   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
   431                                                               \r (no-eol) (esc)
       
   432   \r (no-eol) (esc)
       
   433                                                               \r (no-eol) (esc)
   316   removing issue1861/b/c/y (glob)
   434   removing issue1861/b/c/y (glob)
   317   $ hg ci -m remove
   435   $ hg ci -m remove
   318   $ ls issue1861
   436   $ ls issue1861
   319   x
   437   x
   320 
   438 
   331 handling of untracked directories and missing files
   449 handling of untracked directories and missing files
   332 
   450 
   333   $ mkdir d1
   451   $ mkdir d1
   334   $ echo a > d1/a
   452   $ echo a > d1/a
   335   $ hg rm --after d1
   453   $ hg rm --after d1
       
   454   \r (no-eol) (esc)
       
   455   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
   456                                                               \r (no-eol) (esc)
   336   not removing d1: no tracked files
   457   not removing d1: no tracked files
   337   [1]
   458   [1]
   338   $ hg add d1/a
   459   $ hg add d1/a
   339   $ rm d1/a
   460   $ rm d1/a
   340   $ hg rm --after d1
   461   $ hg rm --after d1
       
   462   \r (no-eol) (esc)
       
   463   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
   464                                                               \r (no-eol) (esc)
       
   465   \r (no-eol) (esc)
       
   466   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
   467                                                               \r (no-eol) (esc)
       
   468   \r (no-eol) (esc)
       
   469                                                               \r (no-eol) (esc)
   341   removing d1/a (glob)
   470   removing d1/a (glob)
   342 #if windows
   471 #if windows
   343   $ hg rm --after nosuch
   472   $ hg rm --after nosuch
   344   nosuch: * (glob)
   473   nosuch: * (glob)
   345   [1]
   474   [1]
   346 #else
   475 #else
   347   $ hg rm --after nosuch
   476   $ hg rm --after nosuch
   348   nosuch: No such file or directory
   477   nosuch: No such file or directory
       
   478   \r (no-eol) (esc)
       
   479   deleting [===========================================>] 1/1\r (no-eol) (esc)
       
   480                                                               \r (no-eol) (esc)
   349   [1]
   481   [1]
   350 #endif
   482 #endif