tests/test-revert-interactive.t
changeset 42566 f802a75da585
parent 42071 db72f9f6580e
child 44724 5c2a4f37eace
equal deleted inserted replaced
42565:4764e8436b2a 42566:f802a75da585
    53   > EOF
    53   > EOF
    54   remove added file folder1/i (Yn)? y
    54   remove added file folder1/i (Yn)? y
    55   removing folder1/i
    55   removing folder1/i
    56   diff --git a/f b/f
    56   diff --git a/f b/f
    57   2 hunks, 2 lines changed
    57   2 hunks, 2 lines changed
    58   examine changes to 'f'? [Ynesfdaq?] y
    58   examine changes to 'f'?
       
    59   (enter ? for help) [Ynesfdaq?] y
    59   
    60   
    60   @@ -1,6 +1,5 @@
    61   @@ -1,6 +1,5 @@
    61   -a
    62   -a
    62    1
    63    1
    63    2
    64    2
    64    3
    65    3
    65    4
    66    4
    66    5
    67    5
    67   apply change 1/6 to 'f'? [Ynesfdaq?] y
    68   apply change 1/6 to 'f'?
       
    69   (enter ? for help) [Ynesfdaq?] y
    68   
    70   
    69   @@ -2,6 +1,5 @@
    71   @@ -2,6 +1,5 @@
    70    1
    72    1
    71    2
    73    2
    72    3
    74    3
    73    4
    75    4
    74    5
    76    5
    75   -b
    77   -b
    76   apply change 2/6 to 'f'? [Ynesfdaq?] y
    78   apply change 2/6 to 'f'?
       
    79   (enter ? for help) [Ynesfdaq?] y
    77   
    80   
    78   diff --git a/folder1/g b/folder1/g
    81   diff --git a/folder1/g b/folder1/g
    79   2 hunks, 2 lines changed
    82   2 hunks, 2 lines changed
    80   examine changes to 'folder1/g'? [Ynesfdaq?] y
    83   examine changes to 'folder1/g'?
       
    84   (enter ? for help) [Ynesfdaq?] y
    81   
    85   
    82   @@ -1,6 +1,5 @@
    86   @@ -1,6 +1,5 @@
    83   -c
    87   -c
    84    1
    88    1
    85    2
    89    2
    86    3
    90    3
    87    4
    91    4
    88    5
    92    5
    89   apply change 3/6 to 'folder1/g'? [Ynesfdaq?] ?
    93   apply change 3/6 to 'folder1/g'?
       
    94   (enter ? for help) [Ynesfdaq?] ?
    90   
    95   
    91   y - yes, apply this change
    96   y - yes, apply this change
    92   n - no, skip this change
    97   n - no, skip this change
    93   e - edit this change manually
    98   e - edit this change manually
    94   s - skip remaining changes to this file
    99   s - skip remaining changes to this file
    95   f - apply remaining changes to this file
   100   f - apply remaining changes to this file
    96   d - done, skip remaining changes and files
   101   d - done, skip remaining changes and files
    97   a - apply all changes to all remaining files
   102   a - apply all changes to all remaining files
    98   q - quit, applying no changes
   103   q - quit, applying no changes
    99   ? - ? (display help)
   104   ? - ? (display help)
   100   apply change 3/6 to 'folder1/g'? [Ynesfdaq?] y
   105   apply change 3/6 to 'folder1/g'?
       
   106   (enter ? for help) [Ynesfdaq?] y
   101   
   107   
   102   @@ -2,6 +1,5 @@
   108   @@ -2,6 +1,5 @@
   103    1
   109    1
   104    2
   110    2
   105    3
   111    3
   106    4
   112    4
   107    5
   113    5
   108   -d
   114   -d
   109   apply change 4/6 to 'folder1/g'? [Ynesfdaq?] n
   115   apply change 4/6 to 'folder1/g'?
       
   116   (enter ? for help) [Ynesfdaq?] n
   110   
   117   
   111   diff --git a/folder2/h b/folder2/h
   118   diff --git a/folder2/h b/folder2/h
   112   2 hunks, 2 lines changed
   119   2 hunks, 2 lines changed
   113   examine changes to 'folder2/h'? [Ynesfdaq?] n
   120   examine changes to 'folder2/h'?
       
   121   (enter ? for help) [Ynesfdaq?] n
   114   
   122   
   115   reverting f
   123   reverting f
   116   reverting folder1/g
   124   reverting folder1/g
   117   $ cat f
   125   $ cat f
   118   1
   126   1
   139 Test that --interactive lift the need for --all
   147 Test that --interactive lift the need for --all
   140 
   148 
   141   $ echo q | hg revert -i -r 2
   149   $ echo q | hg revert -i -r 2
   142   diff --git a/folder1/g b/folder1/g
   150   diff --git a/folder1/g b/folder1/g
   143   1 hunks, 1 lines changed
   151   1 hunks, 1 lines changed
   144   examine changes to 'folder1/g'? [Ynesfdaq?] q
   152   examine changes to 'folder1/g'?
       
   153   (enter ? for help) [Ynesfdaq?] q
   145   
   154   
   146   abort: user quit
   155   abort: user quit
   147   [255]
   156   [255]
   148   $ ls folder1/
   157   $ ls folder1/
   149   g
   158   g
   155   @@ -3,4 +3,3 @@
   164   @@ -3,4 +3,3 @@
   156    3
   165    3
   157    4
   166    4
   158    5
   167    5
   159   -d
   168   -d
   160   apply this change to 'folder1/g'? [Ynesfdaq?] n
   169   apply this change to 'folder1/g'?
       
   170   (enter ? for help) [Ynesfdaq?] n
   161   
   171   
   162   $ ls folder1/
   172   $ ls folder1/
   163   g
   173   g
   164 
   174 
   165 Test --no-backup
   175 Test --no-backup
   169   @@ -3,4 +3,3 @@
   179   @@ -3,4 +3,3 @@
   170    3
   180    3
   171    4
   181    4
   172    5
   182    5
   173   -d
   183   -d
   174   apply this change to 'folder1/g'? [Ynesfdaq?] y
   184   apply this change to 'folder1/g'?
       
   185   (enter ? for help) [Ynesfdaq?] y
   175   
   186   
   176   $ ls folder1/
   187   $ ls folder1/
   177   g
   188   g
   178   >>> open('folder1/g', 'wb').write(b"1\n2\n3\n4\n5\nd\n") and None
   189   >>> open('folder1/g', 'wb').write(b"1\n2\n3\n4\n5\nd\n") and None
   179 
   190 
   191   > n
   202   > n
   192   > EOF
   203   > EOF
   193   remove added file folder1/i (Yn)? n
   204   remove added file folder1/i (Yn)? n
   194   diff --git a/f b/f
   205   diff --git a/f b/f
   195   2 hunks, 2 lines changed
   206   2 hunks, 2 lines changed
   196   examine changes to 'f'? [Ynesfdaq?] y
   207   examine changes to 'f'?
       
   208   (enter ? for help) [Ynesfdaq?] y
   197   
   209   
   198   @@ -1,6 +1,5 @@
   210   @@ -1,6 +1,5 @@
   199   -a
   211   -a
   200    1
   212    1
   201    2
   213    2
   202    3
   214    3
   203    4
   215    4
   204    5
   216    5
   205   apply change 1/6 to 'f'? [Ynesfdaq?] y
   217   apply change 1/6 to 'f'?
       
   218   (enter ? for help) [Ynesfdaq?] y
   206   
   219   
   207   @@ -2,6 +1,5 @@
   220   @@ -2,6 +1,5 @@
   208    1
   221    1
   209    2
   222    2
   210    3
   223    3
   211    4
   224    4
   212    5
   225    5
   213   -b
   226   -b
   214   apply change 2/6 to 'f'? [Ynesfdaq?] y
   227   apply change 2/6 to 'f'?
       
   228   (enter ? for help) [Ynesfdaq?] y
   215   
   229   
   216   diff --git a/folder1/g b/folder1/g
   230   diff --git a/folder1/g b/folder1/g
   217   2 hunks, 2 lines changed
   231   2 hunks, 2 lines changed
   218   examine changes to 'folder1/g'? [Ynesfdaq?] y
   232   examine changes to 'folder1/g'?
       
   233   (enter ? for help) [Ynesfdaq?] y
   219   
   234   
   220   @@ -1,6 +1,5 @@
   235   @@ -1,6 +1,5 @@
   221   -c
   236   -c
   222    1
   237    1
   223    2
   238    2
   224    3
   239    3
   225    4
   240    4
   226    5
   241    5
   227   apply change 3/6 to 'folder1/g'? [Ynesfdaq?] y
   242   apply change 3/6 to 'folder1/g'?
       
   243   (enter ? for help) [Ynesfdaq?] y
   228   
   244   
   229   @@ -2,6 +1,5 @@
   245   @@ -2,6 +1,5 @@
   230    1
   246    1
   231    2
   247    2
   232    3
   248    3
   233    4
   249    4
   234    5
   250    5
   235   -d
   251   -d
   236   apply change 4/6 to 'folder1/g'? [Ynesfdaq?] n
   252   apply change 4/6 to 'folder1/g'?
       
   253   (enter ? for help) [Ynesfdaq?] n
   237   
   254   
   238   diff --git a/folder2/h b/folder2/h
   255   diff --git a/folder2/h b/folder2/h
   239   2 hunks, 2 lines changed
   256   2 hunks, 2 lines changed
   240   examine changes to 'folder2/h'? [Ynesfdaq?] n
   257   examine changes to 'folder2/h'?
       
   258   (enter ? for help) [Ynesfdaq?] n
   241   
   259   
   242   reverting f
   260   reverting f
   243   reverting folder1/g
   261   reverting folder1/g
   244   $ cat f
   262   $ cat f
   245   1
   263   1
   278    1
   296    1
   279    2
   297    2
   280    3
   298    3
   281    4
   299    4
   282    5
   300    5
   283   discard change 1/2 to 'f'? [Ynesfdaq?] ?
   301   discard change 1/2 to 'f'?
       
   302   (enter ? for help) [Ynesfdaq?] ?
   284   
   303   
   285   y - yes, discard this change
   304   y - yes, discard this change
   286   n - no, skip this change
   305   n - no, skip this change
   287   e - edit this change manually
   306   e - edit this change manually
   288   s - skip remaining changes to this file
   307   s - skip remaining changes to this file
   289   f - discard remaining changes to this file
   308   f - discard remaining changes to this file
   290   d - done, skip remaining changes and files
   309   d - done, skip remaining changes and files
   291   a - discard all changes to all remaining files
   310   a - discard all changes to all remaining files
   292   q - quit, discarding no changes
   311   q - quit, discarding no changes
   293   ? - ? (display help)
   312   ? - ? (display help)
   294   discard change 1/2 to 'f'? [Ynesfdaq?] y
   313   discard change 1/2 to 'f'?
       
   314   (enter ? for help) [Ynesfdaq?] y
   295   
   315   
   296   @@ -2,6 +1,5 @@
   316   @@ -2,6 +1,5 @@
   297    1
   317    1
   298    2
   318    2
   299    3
   319    3
   300    4
   320    4
   301    5
   321    5
   302   -b
   322   -b
   303   discard change 2/2 to 'f'? [Ynesfdaq?] n
   323   discard change 2/2 to 'f'?
       
   324   (enter ? for help) [Ynesfdaq?] n
   304   
   325   
   305   $ hg st
   326   $ hg st
   306   M f
   327   M f
   307   M folder1/g
   328   M folder1/g
   308   ? f.orig
   329   ? f.orig
   327   > y
   348   > y
   328   > n
   349   > n
   329   > EOF
   350   > EOF
   330   diff --git a/f b/f
   351   diff --git a/f b/f
   331   1 hunks, 1 lines changed
   352   1 hunks, 1 lines changed
   332   examine changes to 'f'? [Ynesfdaq?] y
   353   examine changes to 'f'?
       
   354   (enter ? for help) [Ynesfdaq?] y
   333   
   355   
   334   @@ -4,4 +4,3 @@
   356   @@ -4,4 +4,3 @@
   335    3
   357    3
   336    4
   358    4
   337    5
   359    5
   338   -b
   360   -b
   339   discard this change to 'f'? [Ynesfdaq?] n
   361   discard this change to 'f'?
       
   362   (enter ? for help) [Ynesfdaq?] n
   340   
   363   
   341 
   364 
   342   $ hg update -C .
   365   $ hg update -C .
   343   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   366   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   344 
   367 
   361   > y
   384   > y
   362   > e
   385   > e
   363   > EOF
   386   > EOF
   364   diff --git a/k b/k
   387   diff --git a/k b/k
   365   1 hunks, 2 lines changed
   388   1 hunks, 2 lines changed
   366   examine changes to 'k'? [Ynesfdaq?] y
   389   examine changes to 'k'?
       
   390   (enter ? for help) [Ynesfdaq?] y
   367   
   391   
   368   @@ -1,1 +1,2 @@
   392   @@ -1,1 +1,2 @@
   369   -1
   393   -1
   370   +0
   394   +0
   371   +2
   395   +2
   372   discard this change to 'k'? [Ynesfdaq?] e
   396   discard this change to 'k'?
       
   397   (enter ? for help) [Ynesfdaq?] e
   373   
   398   
   374   reverting k
   399   reverting k
   375   $ cat k
   400   $ cat k
   376   42
   401   42
   377 
   402 
   412   > y
   437   > y
   413   > y
   438   > y
   414   > EOF
   439   > EOF
   415   diff --git a/a b/a
   440   diff --git a/a b/a
   416   1 hunks, 1 lines changed
   441   1 hunks, 1 lines changed
   417   examine changes to 'a'? [Ynesfdaq?] y
   442   examine changes to 'a'?
       
   443   (enter ? for help) [Ynesfdaq?] y
   418   
   444   
   419   @@ -1,2 +1,1 @@
   445   @@ -1,2 +1,1 @@
   420    0
   446    0
   421   -1
   447   -1
   422   \ No newline at end of file
   448   \ No newline at end of file
   423   apply this change to 'a'? [Ynesfdaq?] y
   449   apply this change to 'a'?
       
   450   (enter ? for help) [Ynesfdaq?] y
   424   
   451   
   425   reverting a
   452   reverting a
   426   $ cat a
   453   $ cat a
   427   0
   454   0
   428 
   455 
   486   > n
   513   > n
   487   > e
   514   > e
   488   > EOF
   515   > EOF
   489   diff --git a/a b/a
   516   diff --git a/a b/a
   490   2 hunks, 2 lines changed
   517   2 hunks, 2 lines changed
   491   examine changes to 'a'? [Ynesfdaq?] y
   518   examine changes to 'a'?
       
   519   (enter ? for help) [Ynesfdaq?] y
   492   
   520   
   493   @@ -1,1 +1,2 @@
   521   @@ -1,1 +1,2 @@
   494   +x
   522   +x
   495    a
   523    a
   496   keep change 1/2 to 'a'? [Ynesfdaq?] n
   524   keep change 1/2 to 'a'?
       
   525   (enter ? for help) [Ynesfdaq?] n
   497   
   526   
   498   @@ -1,1 +2,2 @@
   527   @@ -1,1 +2,2 @@
   499    a
   528    a
   500   +y
   529   +y
   501   keep change 2/2 to 'a'? [Ynesfdaq?] e
   530   keep change 2/2 to 'a'?
       
   531   (enter ? for help) [Ynesfdaq?] e
   502   
   532   
   503   reverting a
   533   reverting a
   504   $ cat a
   534   $ cat a
   505   a
   535   a
   506   y
   536   y