tests/test-revert.t
changeset 22123 7740db54bf73
parent 22099 9ed5e1053303
child 22124 e51784473fc0
equal deleted inserted replaced
22119:fd172ba5c64b 22123:7740db54bf73
    17 Introduce some changes and revert them
    17 Introduce some changes and revert them
    18 --------------------------------------
    18 --------------------------------------
    19 
    19 
    20   $ echo 123 > b
    20   $ echo 123 > b
    21 
    21 
    22 should show b unknown
       
    23 
       
    24   $ hg status
    22   $ hg status
    25   ? b
    23   ? b
    26   $ echo 12 > c
    24   $ echo 12 > c
    27 
    25 
    28 should show b unknown and c modified
       
    29 
       
    30   $ hg status
    26   $ hg status
    31   M c
    27   M c
    32   ? b
    28   ? b
    33   $ hg add b
    29   $ hg add b
    34 
    30 
    35 should show b added and c modified
       
    36 
       
    37   $ hg status
    31   $ hg status
    38   M c
    32   M c
    39   A b
    33   A b
    40   $ hg rm a
    34   $ hg rm a
    41 
    35 
    42 should show a removed, b added and c modified
       
    43 
       
    44   $ hg status
    36   $ hg status
    45   M c
    37   M c
    46   A b
    38   A b
    47   R a
    39   R a
    48 
    40 
    49 revert removal of a file
    41 revert removal of a file
    50 
    42 
    51   $ hg revert a
    43   $ hg revert a
    52 
       
    53 should show b added, copy saved, and c modified
       
    54 
       
    55   $ hg status
    44   $ hg status
    56   M c
    45   M c
    57   A b
    46   A b
    58 
    47 
    59 revert addition of a file
    48 revert addition of a file
    60 
    49 
    61   $ hg revert b
    50   $ hg revert b
    62 
       
    63 should show b unknown, and c modified
       
    64 
       
    65   $ hg status
    51   $ hg status
    66   M c
    52   M c
    67   ? b
    53   ? b
    68 
    54 
    69 revert modification of a file (--no-backup)
    55 revert modification of a file (--no-backup)
    70 
    56 
    71   $ hg revert --no-backup c
    57   $ hg revert --no-backup c
    72 
       
    73 should show unknown: b
       
    74 
       
    75   $ hg status
    58   $ hg status
    76   ? b
    59   ? b
    77 
    60 
    78 revert deletion (! status) of a added file
    61 revert deletion (! status) of a added file
    79 ------------------------------------------
    62 ------------------------------------------
    80 
    63 
    81   $ hg add b
    64   $ hg add b
    82 
       
    83 should show b added
       
    84 
    65 
    85   $ hg status b
    66   $ hg status b
    86   A b
    67   A b
    87   $ rm b
    68   $ rm b
    88 
       
    89 should show b deleted
       
    90 
       
    91   $ hg status b
    69   $ hg status b
    92   ! b
    70   ! b
    93   $ hg revert -v b
    71   $ hg revert -v b
    94   forgetting b
    72   forgetting b
    95 
       
    96 should not find b
       
    97 
       
    98   $ hg status b
    73   $ hg status b
    99   b: * (glob)
    74   b: * (glob)
   100 
       
   101 should show a c e
       
   102 
    75 
   103   $ ls
    76   $ ls
   104   a
    77   a
   105   c
    78   c
   106   e
    79   e
   185 #if execbit
   158 #if execbit
   186   $ chmod +x c
   159   $ chmod +x c
   187   $ hg revert --all
   160   $ hg revert --all
   188   reverting c
   161   reverting c
   189 
   162 
   190 should print non-executable
       
   191 
       
   192   $ test -x c || echo non-executable
   163   $ test -x c || echo non-executable
   193   non-executable
   164   non-executable
   194 
   165 
   195   $ chmod +x c
   166   $ chmod +x c
   196   $ hg commit -m exe
   167   $ hg commit -m exe
   197 
   168 
   198   $ chmod -x c
   169   $ chmod -x c
   199   $ hg revert --all
   170   $ hg revert --all
   200   reverting c
   171   reverting c
   201 
       
   202 should print executable
       
   203 
   172 
   204   $ test -x c && echo executable
   173   $ test -x c && echo executable
   205   executable
   174   executable
   206 #endif
   175 #endif
   207 
   176