tests/test-revert-interactive.t
changeset 24359 521fe8287dd5
child 24361 8de8cd34f2e3
equal deleted inserted replaced
24358:8d9e9063b040 24359:521fe8287dd5
       
     1 Revert interactive tests
       
     2 1 add and commit file f
       
     3 2 add commit file folder1/g
       
     4 3 add and commit file folder2/h
       
     5 4 add and commit file folder1/i
       
     6 5 commit change to file f
       
     7 6 commit changes to files folder1/g folder2/h
       
     8 7 commit changes to files folder1/g folder2/h
       
     9 8 revert interactive to commit id 2 (line 3 above), check that folder1/i is removed and
       
    10 9 make workdir match 7
       
    11 10 run the same test than 8 from within folder1 and check same expectations
       
    12 
       
    13   $ cat <<EOF >> $HGRCPATH
       
    14   > [ui]
       
    15   > interactive = true
       
    16   > [extensions]
       
    17   > record =
       
    18   > EOF
       
    19 
       
    20 
       
    21   $ mkdir -p a/{folder1,folder2}
       
    22   $ cd a
       
    23   $ hg init
       
    24   $ seq 1 5 > f ; hg add f ; hg commit -m "adding f"
       
    25   $ seq 1 5 > folder1/g ; hg add folder1/g ; hg commit -m "adding folder1/g"
       
    26   $ seq 1 5 > folder2/h ; hg add folder2/h ; hg commit -m "adding folder2/h"
       
    27   $ seq 1 5 > folder1/i ; hg add folder1/i ; hg commit -m "adding folder1/i"
       
    28   $ echo "a" > f ; seq 1 5 >> f ; echo "b" >> f ; hg commit -m "modifying f"
       
    29   $ echo "c" > folder1/g ; seq 1 5 >> folder1/g ; echo "d" >> folder1/g ; hg commit -m "modifying folder1/g"
       
    30   $ echo "e" > folder2/h ; seq 1 5 >> folder2/h ; echo "f" >> folder2/h ; hg commit -m "modifying folder2/h"
       
    31   $ hg tip
       
    32   changeset:   6:59dd6e4ab63a
       
    33   tag:         tip
       
    34   user:        test
       
    35   date:        Thu Jan 01 00:00:00 1970 +0000
       
    36   summary:     modifying folder2/h
       
    37   
       
    38   $ hg revert -i -r 2 --all -- << EOF
       
    39   > y
       
    40   > y
       
    41   > y
       
    42   > y
       
    43   > y
       
    44   > n
       
    45   > n
       
    46   > EOF
       
    47   reverting f
       
    48   reverting folder1/g (glob)
       
    49   removing folder1/i (glob)
       
    50   reverting folder2/h (glob)
       
    51   diff -r 89ac3d72e4a4 f
       
    52   2 hunks, 2 lines changed
       
    53   examine changes to 'f'? [Ynesfdaq?] y
       
    54   
       
    55   @@ -1,6 +1,5 @@
       
    56   -a
       
    57    1
       
    58    2
       
    59    3
       
    60    4
       
    61    5
       
    62   record change 1/6 to 'f'? [Ynesfdaq?] y
       
    63   
       
    64   @@ -2,6 +1,5 @@
       
    65    1
       
    66    2
       
    67    3
       
    68    4
       
    69    5
       
    70   -b
       
    71   record change 2/6 to 'f'? [Ynesfdaq?] y
       
    72   
       
    73   diff -r 89ac3d72e4a4 folder1/g
       
    74   2 hunks, 2 lines changed
       
    75   examine changes to 'folder1/g'? [Ynesfdaq?] y
       
    76   
       
    77   @@ -1,6 +1,5 @@
       
    78   -c
       
    79    1
       
    80    2
       
    81    3
       
    82    4
       
    83    5
       
    84   record change 3/6 to 'folder1/g'? [Ynesfdaq?] y
       
    85   
       
    86   @@ -2,6 +1,5 @@
       
    87    1
       
    88    2
       
    89    3
       
    90    4
       
    91    5
       
    92   -d
       
    93   record change 4/6 to 'folder1/g'? [Ynesfdaq?] n
       
    94   
       
    95   diff -r 89ac3d72e4a4 folder2/h
       
    96   2 hunks, 2 lines changed
       
    97   examine changes to 'folder2/h'? [Ynesfdaq?] n
       
    98   
       
    99   $ cat f
       
   100   1
       
   101   2
       
   102   3
       
   103   4
       
   104   5
       
   105   $ cat folder1/g
       
   106   1
       
   107   2
       
   108   3
       
   109   4
       
   110   5
       
   111   d
       
   112   $ cat folder2/h
       
   113   e
       
   114   1
       
   115   2
       
   116   3
       
   117   4
       
   118   5
       
   119   f
       
   120   $ hg update -C 6
       
   121   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   122   $ hg revert -i -r 2 --all -- << EOF
       
   123   > y
       
   124   > y
       
   125   > y
       
   126   > y
       
   127   > y
       
   128   > n
       
   129   > n
       
   130   > EOF
       
   131   reverting f
       
   132   reverting folder1/g (glob)
       
   133   removing folder1/i (glob)
       
   134   reverting folder2/h (glob)
       
   135   diff -r 89ac3d72e4a4 f
       
   136   2 hunks, 2 lines changed
       
   137   examine changes to 'f'? [Ynesfdaq?] y
       
   138   
       
   139   @@ -1,6 +1,5 @@
       
   140   -a
       
   141    1
       
   142    2
       
   143    3
       
   144    4
       
   145    5
       
   146   record change 1/6 to 'f'? [Ynesfdaq?] y
       
   147   
       
   148   @@ -2,6 +1,5 @@
       
   149    1
       
   150    2
       
   151    3
       
   152    4
       
   153    5
       
   154   -b
       
   155   record change 2/6 to 'f'? [Ynesfdaq?] y
       
   156   
       
   157   diff -r 89ac3d72e4a4 folder1/g
       
   158   2 hunks, 2 lines changed
       
   159   examine changes to 'folder1/g'? [Ynesfdaq?] y
       
   160   
       
   161   @@ -1,6 +1,5 @@
       
   162   -c
       
   163    1
       
   164    2
       
   165    3
       
   166    4
       
   167    5
       
   168   record change 3/6 to 'folder1/g'? [Ynesfdaq?] y
       
   169   
       
   170   @@ -2,6 +1,5 @@
       
   171    1
       
   172    2
       
   173    3
       
   174    4
       
   175    5
       
   176   -d
       
   177   record change 4/6 to 'folder1/g'? [Ynesfdaq?] n
       
   178   
       
   179   diff -r 89ac3d72e4a4 folder2/h
       
   180   2 hunks, 2 lines changed
       
   181   examine changes to 'folder2/h'? [Ynesfdaq?] n
       
   182   
       
   183   $ cat f
       
   184   1
       
   185   2
       
   186   3
       
   187   4
       
   188   5
       
   189   $ cat folder1/g
       
   190   1
       
   191   2
       
   192   3
       
   193   4
       
   194   5
       
   195   d
       
   196   $ cat folder2/h
       
   197   e
       
   198   1
       
   199   2
       
   200   3
       
   201   4
       
   202   5
       
   203   f