tests/test-record.t
changeset 16324 46b991a1f428
parent 15623 fc8c7a5ccc4a
child 16328 d388c3fc8319
equal deleted inserted replaced
16318:73f4e05287b4 16324:46b991a1f428
    18   $ hg record empty-rw<<EOF
    18   $ hg record empty-rw<<EOF
    19   > n
    19   > n
    20   > EOF
    20   > EOF
    21   diff --git a/empty-rw b/empty-rw
    21   diff --git a/empty-rw b/empty-rw
    22   new file mode 100644
    22   new file mode 100644
    23   examine changes to 'empty-rw'? [Ynsfdaq?] 
    23   examine changes to 'empty-rw'? [Ynesfdaq?] 
    24   no changes to record
    24   no changes to record
    25 
    25 
    26   $ hg tip -p
    26   $ hg tip -p
    27   changeset:   -1:000000000000
    27   changeset:   -1:000000000000
    28   tag:         tip
    28   tag:         tip
    37   > y
    37   > y
    38   > n
    38   > n
    39   > EOF
    39   > EOF
    40   diff --git a/empty-rw b/empty-rw
    40   diff --git a/empty-rw b/empty-rw
    41   new file mode 100644
    41   new file mode 100644
    42   examine changes to 'empty-rw'? [Ynsfdaq?] 
    42   examine changes to 'empty-rw'? [Ynesfdaq?] 
    43   abort: empty commit message
    43   abort: empty commit message
    44   [255]
    44   [255]
    45 
    45 
    46   $ hg tip -p
    46   $ hg tip -p
    47   changeset:   -1:000000000000
    47   changeset:   -1:000000000000
    57   > y
    57   > y
    58   > y
    58   > y
    59   > EOF
    59   > EOF
    60   diff --git a/empty-rw b/empty-rw
    60   diff --git a/empty-rw b/empty-rw
    61   new file mode 100644
    61   new file mode 100644
    62   examine changes to 'empty-rw'? [Ynsfdaq?] 
    62   examine changes to 'empty-rw'? [Ynesfdaq?] 
    63 
    63 
    64   $ hg tip -p
    64   $ hg tip -p
    65   changeset:   0:c0708cf4e46e
    65   changeset:   0:c0708cf4e46e
    66   tag:         tip
    66   tag:         tip
    67   user:        test
    67   user:        test
    86   > y
    86   > y
    87   > EOF
    87   > EOF
    88   diff --git a/empty-rw b/empty-rename
    88   diff --git a/empty-rw b/empty-rename
    89   rename from empty-rw
    89   rename from empty-rw
    90   rename to empty-rename
    90   rename to empty-rename
    91   examine changes to 'empty-rw' and 'empty-rename'? [Ynsfdaq?] 
    91   examine changes to 'empty-rw' and 'empty-rename'? [Ynesfdaq?] 
    92 
    92 
    93   $ hg tip -p
    93   $ hg tip -p
    94   changeset:   1:d695e8dcb197
    94   changeset:   1:d695e8dcb197
    95   tag:         tip
    95   tag:         tip
    96   user:        test
    96   user:        test
   106   > y
   106   > y
   107   > EOF
   107   > EOF
   108   diff --git a/empty-rename b/empty-copy
   108   diff --git a/empty-rename b/empty-copy
   109   copy from empty-rename
   109   copy from empty-rename
   110   copy to empty-copy
   110   copy to empty-copy
   111   examine changes to 'empty-rename' and 'empty-copy'? [Ynsfdaq?] 
   111   examine changes to 'empty-rename' and 'empty-copy'? [Ynesfdaq?] 
   112 
   112 
   113   $ hg tip -p
   113   $ hg tip -p
   114   changeset:   2:1d4b90bea524
   114   changeset:   2:1d4b90bea524
   115   tag:         tip
   115   tag:         tip
   116   user:        test
   116   user:        test
   125   $ hg record -d '3 0' -m delete<<EOF
   125   $ hg record -d '3 0' -m delete<<EOF
   126   > y
   126   > y
   127   > EOF
   127   > EOF
   128   diff --git a/empty-copy b/empty-copy
   128   diff --git a/empty-copy b/empty-copy
   129   deleted file mode 100644
   129   deleted file mode 100644
   130   examine changes to 'empty-copy'? [Ynsfdaq?] 
   130   examine changes to 'empty-copy'? [Ynesfdaq?] 
   131 
   131 
   132   $ hg tip -p
   132   $ hg tip -p
   133   changeset:   3:b39a238f01a1
   133   changeset:   3:b39a238f01a1
   134   tag:         tip
   134   tag:         tip
   135   user:        test
   135   user:        test
   147   > y
   147   > y
   148   > EOF
   148   > EOF
   149   diff --git a/tip.bundle b/tip.bundle
   149   diff --git a/tip.bundle b/tip.bundle
   150   new file mode 100644
   150   new file mode 100644
   151   this is a binary file
   151   this is a binary file
   152   examine changes to 'tip.bundle'? [Ynsfdaq?] 
   152   examine changes to 'tip.bundle'? [Ynesfdaq?] 
   153 
   153 
   154   $ hg tip -p
   154   $ hg tip -p
   155   changeset:   4:ad816da3711e
   155   changeset:   4:ad816da3711e
   156   tag:         tip
   156   tag:         tip
   157   user:        test
   157   user:        test
   169   $ hg record -d '5 0' -m binary-change<<EOF
   169   $ hg record -d '5 0' -m binary-change<<EOF
   170   > y
   170   > y
   171   > EOF
   171   > EOF
   172   diff --git a/tip.bundle b/tip.bundle
   172   diff --git a/tip.bundle b/tip.bundle
   173   this modifies a binary file (all or nothing)
   173   this modifies a binary file (all or nothing)
   174   examine changes to 'tip.bundle'? [Ynsfdaq?] 
   174   examine changes to 'tip.bundle'? [Ynesfdaq?] 
   175 
   175 
   176   $ hg tip -p
   176   $ hg tip -p
   177   changeset:   5:dccd6f3eb485
   177   changeset:   5:dccd6f3eb485
   178   tag:         tip
   178   tag:         tip
   179   user:        test
   179   user:        test
   194   > EOF
   194   > EOF
   195   diff --git a/tip.bundle b/top.bundle
   195   diff --git a/tip.bundle b/top.bundle
   196   rename from tip.bundle
   196   rename from tip.bundle
   197   rename to top.bundle
   197   rename to top.bundle
   198   this modifies a binary file (all or nothing)
   198   this modifies a binary file (all or nothing)
   199   examine changes to 'tip.bundle' and 'top.bundle'? [Ynsfdaq?] 
   199   examine changes to 'tip.bundle' and 'top.bundle'? [Ynesfdaq?] 
   200 
   200 
   201   $ hg tip -p
   201   $ hg tip -p
   202   changeset:   6:7fa44105f5b3
   202   changeset:   6:7fa44105f5b3
   203   tag:         tip
   203   tag:         tip
   204   user:        test
   204   user:        test
   222   > y
   222   > y
   223   > y
   223   > y
   224   > EOF
   224   > EOF
   225   diff --git a/plain b/plain
   225   diff --git a/plain b/plain
   226   new file mode 100644
   226   new file mode 100644
   227   examine changes to 'plain'? [Ynsfdaq?] 
   227   examine changes to 'plain'? [Ynesfdaq?] 
   228 
   228 
   229   $ hg tip -p
   229   $ hg tip -p
   230   changeset:   7:11fb457c1be4
   230   changeset:   7:11fb457c1be4
   231   tag:         tip
   231   tag:         tip
   232   user:        test
   232   user:        test
   256   > y
   256   > y
   257   > y
   257   > y
   258   > EOF
   258   > EOF
   259   diff --git a/plain b/plain
   259   diff --git a/plain b/plain
   260   1 hunks, 1 lines changed
   260   1 hunks, 1 lines changed
   261   examine changes to 'plain'? [Ynsfdaq?] 
   261   examine changes to 'plain'? [Ynesfdaq?] 
   262   @@ -8,3 +8,4 @@
   262   @@ -8,3 +8,4 @@
   263    8
   263    8
   264    9
   264    9
   265    10
   265    10
   266   +11
   266   +11
   267   record this change to 'plain'? [Ynsfdaq?] 
   267   record this change to 'plain'? [Ynesfdaq?] 
   268 
   268 
   269 Modify end of plain file, no EOL
   269 Modify end of plain file, no EOL
   270 
   270 
   271   $ hg tip --template '{node}' >> plain
   271   $ hg tip --template '{node}' >> plain
   272   $ hg record -d '9 0' -m noeol plain <<EOF
   272   $ hg record -d '9 0' -m noeol plain <<EOF
   273   > y
   273   > y
   274   > y
   274   > y
   275   > EOF
   275   > EOF
   276   diff --git a/plain b/plain
   276   diff --git a/plain b/plain
   277   1 hunks, 1 lines changed
   277   1 hunks, 1 lines changed
   278   examine changes to 'plain'? [Ynsfdaq?] 
   278   examine changes to 'plain'? [Ynesfdaq?] 
   279   @@ -9,3 +9,4 @@
   279   @@ -9,3 +9,4 @@
   280    9
   280    9
   281    10
   281    10
   282    11
   282    11
   283   +7264f99c5f5ff3261504828afa4fb4d406c3af54
   283   +7264f99c5f5ff3261504828afa4fb4d406c3af54
   284   \ No newline at end of file
   284   \ No newline at end of file
   285   record this change to 'plain'? [Ynsfdaq?] 
   285   record this change to 'plain'? [Ynesfdaq?] 
   286 
   286 
   287 Modify end of plain file, add EOL
   287 Modify end of plain file, add EOL
   288 
   288 
   289   $ echo >> plain
   289   $ echo >> plain
   290   $ echo 1 > plain2
   290   $ echo 1 > plain2
   294   > y
   294   > y
   295   > y
   295   > y
   296   > EOF
   296   > EOF
   297   diff --git a/plain b/plain
   297   diff --git a/plain b/plain
   298   1 hunks, 1 lines changed
   298   1 hunks, 1 lines changed
   299   examine changes to 'plain'? [Ynsfdaq?] 
   299   examine changes to 'plain'? [Ynesfdaq?] 
   300   @@ -9,4 +9,4 @@
   300   @@ -9,4 +9,4 @@
   301    9
   301    9
   302    10
   302    10
   303    11
   303    11
   304   -7264f99c5f5ff3261504828afa4fb4d406c3af54
   304   -7264f99c5f5ff3261504828afa4fb4d406c3af54
   305   \ No newline at end of file
   305   \ No newline at end of file
   306   +7264f99c5f5ff3261504828afa4fb4d406c3af54
   306   +7264f99c5f5ff3261504828afa4fb4d406c3af54
   307   record change 1/2 to 'plain'? [Ynsfdaq?] 
   307   record change 1/2 to 'plain'? [Ynesfdaq?] 
   308   diff --git a/plain2 b/plain2
   308   diff --git a/plain2 b/plain2
   309   new file mode 100644
   309   new file mode 100644
   310   examine changes to 'plain2'? [Ynsfdaq?] 
   310   examine changes to 'plain2'? [Ynesfdaq?] 
   311 
   311 
   312 Modify beginning, trim end, record both, add another file to test
   312 Modify beginning, trim end, record both, add another file to test
   313 changes numbering
   313 changes numbering
   314 
   314 
   315   $ rm plain
   315   $ rm plain
   325   > y
   325   > y
   326   > y
   326   > y
   327   > EOF
   327   > EOF
   328   diff --git a/plain b/plain
   328   diff --git a/plain b/plain
   329   2 hunks, 3 lines changed
   329   2 hunks, 3 lines changed
   330   examine changes to 'plain'? [Ynsfdaq?] 
   330   examine changes to 'plain'? [Ynesfdaq?] 
   331   @@ -1,4 +1,4 @@
   331   @@ -1,4 +1,4 @@
   332   -1
   332   -1
   333   +2
   333   +2
   334    2
   334    2
   335    3
   335    3
   336    4
   336    4
   337   record change 1/3 to 'plain'? [Ynsfdaq?] 
   337   record change 1/3 to 'plain'? [Ynesfdaq?] 
   338   @@ -8,5 +8,3 @@
   338   @@ -8,5 +8,3 @@
   339    8
   339    8
   340    9
   340    9
   341    10
   341    10
   342   -11
   342   -11
   343   -7264f99c5f5ff3261504828afa4fb4d406c3af54
   343   -7264f99c5f5ff3261504828afa4fb4d406c3af54
   344   record change 2/3 to 'plain'? [Ynsfdaq?] 
   344   record change 2/3 to 'plain'? [Ynesfdaq?] 
   345   diff --git a/plain2 b/plain2
   345   diff --git a/plain2 b/plain2
   346   1 hunks, 1 lines changed
   346   1 hunks, 1 lines changed
   347   examine changes to 'plain2'? [Ynsfdaq?] 
   347   examine changes to 'plain2'? [Ynesfdaq?] 
   348   @@ -1,1 +1,2 @@
   348   @@ -1,1 +1,2 @@
   349    1
   349    1
   350   +2
   350   +2
   351   record change 3/3 to 'plain2'? [Ynsfdaq?] 
   351   record change 3/3 to 'plain2'? [Ynesfdaq?] 
   352 
   352 
   353   $ hg tip -p
   353   $ hg tip -p
   354   changeset:   11:21df83db12b8
   354   changeset:   11:21df83db12b8
   355   tag:         tip
   355   tag:         tip
   356   user:        test
   356   user:        test
   394   > n
   394   > n
   395   > y
   395   > y
   396   > EOF
   396   > EOF
   397   diff --git a/plain b/plain
   397   diff --git a/plain b/plain
   398   2 hunks, 4 lines changed
   398   2 hunks, 4 lines changed
   399   examine changes to 'plain'? [Ynsfdaq?] 
   399   examine changes to 'plain'? [Ynesfdaq?] 
   400   @@ -1,9 +1,6 @@
   400   @@ -1,9 +1,6 @@
   401   -2
   401   -2
   402   -2
   402   -2
   403   -3
   403   -3
   404    4
   404    4
   405    5
   405    5
   406    6
   406    6
   407    7
   407    7
   408    8
   408    8
   409    9
   409    9
   410   record change 1/2 to 'plain'? [Ynsfdaq?] 
   410   record change 1/2 to 'plain'? [Ynesfdaq?] 
   411   @@ -4,7 +1,7 @@
   411   @@ -4,7 +1,7 @@
   412    4
   412    4
   413    5
   413    5
   414    6
   414    6
   415    7
   415    7
   416    8
   416    8
   417    9
   417    9
   418   -10
   418   -10
   419   +10.new
   419   +10.new
   420   record change 2/2 to 'plain'? [Ynsfdaq?] 
   420   record change 2/2 to 'plain'? [Ynesfdaq?] 
   421 
   421 
   422   $ hg tip -p
   422   $ hg tip -p
   423   changeset:   12:99337501826f
   423   changeset:   12:99337501826f
   424   tag:         tip
   424   tag:         tip
   425   user:        test
   425   user:        test
   443   > y
   443   > y
   444   > y
   444   > y
   445   > EOF
   445   > EOF
   446   diff --git a/plain b/plain
   446   diff --git a/plain b/plain
   447   1 hunks, 3 lines changed
   447   1 hunks, 3 lines changed
   448   examine changes to 'plain'? [Ynsfdaq?] 
   448   examine changes to 'plain'? [Ynesfdaq?] 
   449   @@ -1,6 +1,3 @@
   449   @@ -1,6 +1,3 @@
   450   -2
   450   -2
   451   -2
   451   -2
   452   -3
   452   -3
   453    4
   453    4
   454    5
   454    5
   455    6
   455    6
   456   record this change to 'plain'? [Ynsfdaq?] 
   456   record this change to 'plain'? [Ynesfdaq?] 
   457 
   457 
   458   $ hg tip -p
   458   $ hg tip -p
   459   changeset:   13:bbd45465d540
   459   changeset:   13:bbd45465d540
   460   tag:         tip
   460   tag:         tip
   461   user:        test
   461   user:        test
   488   > n
   488   > n
   489   > y
   489   > y
   490   > EOF
   490   > EOF
   491   diff --git a/plain b/plain
   491   diff --git a/plain b/plain
   492   2 hunks, 4 lines changed
   492   2 hunks, 4 lines changed
   493   examine changes to 'plain'? [Ynsfdaq?] 
   493   examine changes to 'plain'? [Ynesfdaq?] 
   494   @@ -1,6 +1,9 @@
   494   @@ -1,6 +1,9 @@
   495   +1
   495   +1
   496   +2
   496   +2
   497   +3
   497   +3
   498    4
   498    4
   499    5
   499    5
   500    6
   500    6
   501    7
   501    7
   502    8
   502    8
   503    9
   503    9
   504   record change 1/2 to 'plain'? [Ynsfdaq?] 
   504   record change 1/2 to 'plain'? [Ynesfdaq?] 
   505   @@ -1,7 +4,6 @@
   505   @@ -1,7 +4,6 @@
   506    4
   506    4
   507    5
   507    5
   508    6
   508    6
   509    7
   509    7
   510    8
   510    8
   511    9
   511    9
   512   -10.new
   512   -10.new
   513   record change 2/2 to 'plain'? [Ynsfdaq?] 
   513   record change 2/2 to 'plain'? [Ynesfdaq?] 
   514 
   514 
   515 Add to beginning, middle, end
   515 Add to beginning, middle, end
   516 
   516 
   517   $ rm plain
   517   $ rm plain
   518   $ for i in 1 2 3 4 5 5.new 5.reallynew 6 7 8 9 10 11; do
   518   $ for i in 1 2 3 4 5 5.new 5.reallynew 6 7 8 9 10 11; do
   527   > y
   527   > y
   528   > n
   528   > n
   529   > EOF
   529   > EOF
   530   diff --git a/plain b/plain
   530   diff --git a/plain b/plain
   531   3 hunks, 7 lines changed
   531   3 hunks, 7 lines changed
   532   examine changes to 'plain'? [Ynsfdaq?] 
   532   examine changes to 'plain'? [Ynesfdaq?] 
   533   @@ -1,2 +1,5 @@
   533   @@ -1,2 +1,5 @@
   534   +1
   534   +1
   535   +2
   535   +2
   536   +3
   536   +3
   537    4
   537    4
   538    5
   538    5
   539   record change 1/3 to 'plain'? [Ynsfdaq?] 
   539   record change 1/3 to 'plain'? [Ynesfdaq?] 
   540   @@ -1,6 +4,8 @@
   540   @@ -1,6 +4,8 @@
   541    4
   541    4
   542    5
   542    5
   543   +5.new
   543   +5.new
   544   +5.reallynew
   544   +5.reallynew
   545    6
   545    6
   546    7
   546    7
   547    8
   547    8
   548    9
   548    9
   549   record change 2/3 to 'plain'? [Ynsfdaq?] 
   549   record change 2/3 to 'plain'? [Ynesfdaq?] 
   550   @@ -3,4 +8,6 @@
   550   @@ -3,4 +8,6 @@
   551    6
   551    6
   552    7
   552    7
   553    8
   553    8
   554    9
   554    9
   555   +10
   555   +10
   556   +11
   556   +11
   557   record change 3/3 to 'plain'? [Ynsfdaq?] 
   557   record change 3/3 to 'plain'? [Ynesfdaq?] 
   558 
   558 
   559   $ hg tip -p
   559   $ hg tip -p
   560   changeset:   15:f34a7937ec33
   560   changeset:   15:f34a7937ec33
   561   tag:         tip
   561   tag:         tip
   562   user:        test
   562   user:        test
   585   > y
   585   > y
   586   > y
   586   > y
   587   > EOF
   587   > EOF
   588   diff --git a/plain b/plain
   588   diff --git a/plain b/plain
   589   1 hunks, 2 lines changed
   589   1 hunks, 2 lines changed
   590   examine changes to 'plain'? [Ynsfdaq?] 
   590   examine changes to 'plain'? [Ynesfdaq?] 
   591   @@ -9,3 +9,5 @@
   591   @@ -9,3 +9,5 @@
   592    7
   592    7
   593    8
   593    8
   594    9
   594    9
   595   +10
   595   +10
   596   +11
   596   +11
   597   record this change to 'plain'? [Ynsfdaq?] 
   597   record this change to 'plain'? [Ynesfdaq?] 
   598 
   598 
   599   $ hg tip -p
   599   $ hg tip -p
   600   changeset:   16:f9900b71a04c
   600   changeset:   16:f9900b71a04c
   601   tag:         tip
   601   tag:         tip
   602   user:        test
   602   user:        test
   625   > y
   625   > y
   626   > y
   626   > y
   627   > EOF
   627   > EOF
   628   diff --git a/subdir/a b/subdir/a
   628   diff --git a/subdir/a b/subdir/a
   629   1 hunks, 1 lines changed
   629   1 hunks, 1 lines changed
   630   examine changes to 'subdir/a'? [Ynsfdaq?] 
   630   examine changes to 'subdir/a'? [Ynesfdaq?] 
   631   @@ -1,1 +1,2 @@
   631   @@ -1,1 +1,2 @@
   632    a
   632    a
   633   +a
   633   +a
   634   record this change to 'subdir/a'? [Ynsfdaq?] 
   634   record this change to 'subdir/a'? [Ynesfdaq?] 
   635 
   635 
   636   $ hg tip -p
   636   $ hg tip -p
   637   changeset:   18:61be427a9deb
   637   changeset:   18:61be427a9deb
   638   tag:         tip
   638   tag:         tip
   639   user:        test
   639   user:        test
   663   > ?
   663   > ?
   664   > q
   664   > q
   665   > EOF
   665   > EOF
   666   diff --git a/subdir/f1 b/subdir/f1
   666   diff --git a/subdir/f1 b/subdir/f1
   667   1 hunks, 1 lines changed
   667   1 hunks, 1 lines changed
   668   examine changes to 'subdir/f1'? [Ynsfdaq?] 
   668   examine changes to 'subdir/f1'? [Ynesfdaq?] 
   669   y - record this change
   669   y - record this change
   670   n - skip this change
   670   n - skip this change
       
   671   e - edit this change manually
   671   s - skip remaining changes to this file
   672   s - skip remaining changes to this file
   672   f - record remaining changes to this file
   673   f - record remaining changes to this file
   673   d - done, skip remaining changes and files
   674   d - done, skip remaining changes and files
   674   a - record all changes to all remaining files
   675   a - record all changes to all remaining files
   675   q - quit, recording no changes
   676   q - quit, recording no changes
   676   ? - display help
   677   ? - display help
   677   examine changes to 'subdir/f1'? [Ynsfdaq?] 
   678   examine changes to 'subdir/f1'? [Ynesfdaq?] 
   678   abort: user quit
   679   abort: user quit
   679   [255]
   680   [255]
   680 
   681 
   681 Skip
   682 Skip
   682 
   683 
   683   $ hg record <<EOF
   684   $ hg record <<EOF
   684   > s
   685   > s
   685   > EOF
   686   > EOF
   686   diff --git a/subdir/f1 b/subdir/f1
   687   diff --git a/subdir/f1 b/subdir/f1
   687   1 hunks, 1 lines changed
   688   1 hunks, 1 lines changed
   688   examine changes to 'subdir/f1'? [Ynsfdaq?] 
   689   examine changes to 'subdir/f1'? [Ynesfdaq?] 
   689   diff --git a/subdir/f2 b/subdir/f2
   690   diff --git a/subdir/f2 b/subdir/f2
   690   1 hunks, 1 lines changed
   691   1 hunks, 1 lines changed
   691   examine changes to 'subdir/f2'? [Ynsfdaq?] abort: response expected
   692   examine changes to 'subdir/f2'? [Ynesfdaq?] abort: response expected
   692   [255]
   693   [255]
   693 
   694 
   694 No
   695 No
   695 
   696 
   696   $ hg record <<EOF
   697   $ hg record <<EOF
   697   > n
   698   > n
   698   > EOF
   699   > EOF
   699   diff --git a/subdir/f1 b/subdir/f1
   700   diff --git a/subdir/f1 b/subdir/f1
   700   1 hunks, 1 lines changed
   701   1 hunks, 1 lines changed
   701   examine changes to 'subdir/f1'? [Ynsfdaq?] 
   702   examine changes to 'subdir/f1'? [Ynesfdaq?] 
   702   diff --git a/subdir/f2 b/subdir/f2
   703   diff --git a/subdir/f2 b/subdir/f2
   703   1 hunks, 1 lines changed
   704   1 hunks, 1 lines changed
   704   examine changes to 'subdir/f2'? [Ynsfdaq?] abort: response expected
   705   examine changes to 'subdir/f2'? [Ynesfdaq?] abort: response expected
   705   [255]
   706   [255]
   706 
   707 
   707 f, quit
   708 f, quit
   708 
   709 
   709   $ hg record <<EOF
   710   $ hg record <<EOF
   710   > f
   711   > f
   711   > q
   712   > q
   712   > EOF
   713   > EOF
   713   diff --git a/subdir/f1 b/subdir/f1
   714   diff --git a/subdir/f1 b/subdir/f1
   714   1 hunks, 1 lines changed
   715   1 hunks, 1 lines changed
   715   examine changes to 'subdir/f1'? [Ynsfdaq?] 
   716   examine changes to 'subdir/f1'? [Ynesfdaq?] 
   716   diff --git a/subdir/f2 b/subdir/f2
   717   diff --git a/subdir/f2 b/subdir/f2
   717   1 hunks, 1 lines changed
   718   1 hunks, 1 lines changed
   718   examine changes to 'subdir/f2'? [Ynsfdaq?] 
   719   examine changes to 'subdir/f2'? [Ynesfdaq?] 
   719   abort: user quit
   720   abort: user quit
   720   [255]
   721   [255]
   721 
   722 
   722 s, all
   723 s, all
   723 
   724 
   725   > s
   726   > s
   726   > a
   727   > a
   727   > EOF
   728   > EOF
   728   diff --git a/subdir/f1 b/subdir/f1
   729   diff --git a/subdir/f1 b/subdir/f1
   729   1 hunks, 1 lines changed
   730   1 hunks, 1 lines changed
   730   examine changes to 'subdir/f1'? [Ynsfdaq?] 
   731   examine changes to 'subdir/f1'? [Ynesfdaq?] 
   731   diff --git a/subdir/f2 b/subdir/f2
   732   diff --git a/subdir/f2 b/subdir/f2
   732   1 hunks, 1 lines changed
   733   1 hunks, 1 lines changed
   733   examine changes to 'subdir/f2'? [Ynsfdaq?] 
   734   examine changes to 'subdir/f2'? [Ynesfdaq?] 
   734 
   735 
   735   $ hg tip -p
   736   $ hg tip -p
   736   changeset:   20:b3df3dda369a
   737   changeset:   20:b3df3dda369a
   737   tag:         tip
   738   tag:         tip
   738   user:        test
   739   user:        test
   752   $ hg record -d '19 0' -my <<EOF
   753   $ hg record -d '19 0' -my <<EOF
   753   > f
   754   > f
   754   > EOF
   755   > EOF
   755   diff --git a/subdir/f1 b/subdir/f1
   756   diff --git a/subdir/f1 b/subdir/f1
   756   1 hunks, 1 lines changed
   757   1 hunks, 1 lines changed
   757   examine changes to 'subdir/f1'? [Ynsfdaq?] 
   758   examine changes to 'subdir/f1'? [Ynesfdaq?] 
   758 
   759 
   759   $ hg tip -p
   760   $ hg tip -p
   760   changeset:   21:38ec577f126b
   761   changeset:   21:38ec577f126b
   761   tag:         tip
   762   tag:         tip
   762   user:        test
   763   user:        test
   782   > EOF
   783   > EOF
   783   diff --git a/subdir/f1 b/subdir/f1
   784   diff --git a/subdir/f1 b/subdir/f1
   784   old mode 100644
   785   old mode 100644
   785   new mode 100755
   786   new mode 100755
   786   1 hunks, 1 lines changed
   787   1 hunks, 1 lines changed
   787   examine changes to 'subdir/f1'? [Ynsfdaq?] 
   788   examine changes to 'subdir/f1'? [Ynesfdaq?] 
   788   @@ -1,2 +1,3 @@
   789   @@ -1,2 +1,3 @@
   789    a
   790    a
   790    a
   791    a
   791   +a
   792   +a
   792   record this change to 'subdir/f1'? [Ynsfdaq?] 
   793   record this change to 'subdir/f1'? [Ynesfdaq?] 
   793 
   794 
   794   $ hg tip --config diff.git=True -p
   795   $ hg tip --config diff.git=True -p
   795   changeset:   22:3261adceb075
   796   changeset:   22:3261adceb075
   796   tag:         tip
   797   tag:         tip
   797   user:        test
   798   user:        test
   817   > y
   818   > y
   818   > y
   819   > y
   819   > EOF
   820   > EOF
   820   diff --git a/subdir/f1 b/subdir/f1
   821   diff --git a/subdir/f1 b/subdir/f1
   821   1 hunks, 1 lines changed
   822   1 hunks, 1 lines changed
   822   examine changes to 'subdir/f1'? [Ynsfdaq?] 
   823   examine changes to 'subdir/f1'? [Ynesfdaq?] 
   823   @@ -1,3 +1,4 @@
   824   @@ -1,3 +1,4 @@
   824    a
   825    a
   825    a
   826    a
   826    a
   827    a
   827   +b
   828   +b
   828   record this change to 'subdir/f1'? [Ynsfdaq?] 
   829   record this change to 'subdir/f1'? [Ynesfdaq?] 
   829 
   830 
   830   $ hg tip --config diff.git=True -p
   831   $ hg tip --config diff.git=True -p
   831   changeset:   23:b429867550db
   832   changeset:   23:b429867550db
   832   tag:         tip
   833   tag:         tip
   833   user:        test
   834   user:        test
   855   > EOF
   856   > EOF
   856   diff --git a/subdir/f1 b/subdir/f1
   857   diff --git a/subdir/f1 b/subdir/f1
   857   old mode 100755
   858   old mode 100755
   858   new mode 100644
   859   new mode 100644
   859   1 hunks, 1 lines changed
   860   1 hunks, 1 lines changed
   860   examine changes to 'subdir/f1'? [Ynsfdaq?] 
   861   examine changes to 'subdir/f1'? [Ynesfdaq?] 
   861   @@ -2,3 +2,4 @@
   862   @@ -2,3 +2,4 @@
   862    a
   863    a
   863    a
   864    a
   864    b
   865    b
   865   +c
   866   +c
   866   record this change to 'subdir/f1'? [Ynsfdaq?] 
   867   record this change to 'subdir/f1'? [Ynesfdaq?] 
   867 
   868 
   868   $ hg tip --config diff.git=True -p
   869   $ hg tip --config diff.git=True -p
   869   changeset:   24:0b082130c20a
   870   changeset:   24:0b082130c20a
   870   tag:         tip
   871   tag:         tip
   871   user:        test
   872   user:        test
   911   abort: cannot partially commit a merge (use "hg commit" instead)
   912   abort: cannot partially commit a merge (use "hg commit" instead)
   912   [255]
   913   [255]
   913 
   914 
   914   $ hg up -C
   915   $ hg up -C
   915   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   916   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
   917 
       
   918 Editing patch
       
   919 
       
   920   $ cat > editor << '__EOF__'
       
   921   > #!/bin/sh
       
   922   > sed -i -e 7d -e '5s/^-/ /' "$1"
       
   923   > __EOF__
       
   924   $ chmod +x editor
       
   925   $ cat > editedfile << '__EOF__'
       
   926   > This is the first line
       
   927   > This is the second line
       
   928   > This is the third line
       
   929   > __EOF__
       
   930   $ hg add editedfile
       
   931   $ hg commit -medit-patch-1
       
   932   $ cat > editedfile << '__EOF__'
       
   933   > This line has changed
       
   934   > This change will be committed
       
   935   > This is the third line
       
   936   > __EOF__
       
   937   $ HGEDITOR="'`pwd`'"/editor hg record -d '23 0' -medit-patch-2 <<EOF
       
   938   > y
       
   939   > e
       
   940   > EOF
       
   941   diff --git a/editedfile b/editedfile
       
   942   1 hunks, 2 lines changed
       
   943   examine changes to 'editedfile'? [Ynesfdaq?] 
       
   944   @@ -1,3 +1,3 @@
       
   945   -This is the first line
       
   946   -This is the second line
       
   947   +This line has changed
       
   948   +This change will be committed
       
   949    This is the third line
       
   950   record this change to 'editedfile'? [Ynesfdaq?] 
       
   951   $ cat editedfile
       
   952   This line has changed
       
   953   This change will be committed
       
   954   This is the third line
       
   955   $ hg cat -r tip editedfile
       
   956   This is the first line
       
   957   This change will be committed
       
   958   This is the third line
       
   959   $ hg revert editedfile
       
   960 
       
   961 Trying to edit patch for whole file
       
   962 
       
   963   $ echo "This is the fourth line" >> editedfile
       
   964   $ hg record <<EOF
       
   965   > e
       
   966   > q
       
   967   > EOF
       
   968   diff --git a/editedfile b/editedfile
       
   969   1 hunks, 1 lines changed
       
   970   examine changes to 'editedfile'? [Ynesfdaq?] 
       
   971   cannot edit patch for whole file
       
   972   examine changes to 'editedfile'? [Ynesfdaq?] 
       
   973   abort: user quit
       
   974   [255]
       
   975   $ hg revert editedfile
       
   976 
       
   977 Removing changes from patch
       
   978 
       
   979   $ sed -i -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile
       
   980   $ echo "This line has been added" >> editedfile
       
   981   $ cat > editor << '__EOF__'
       
   982   > #!/bin/sh
       
   983   > sed -i -e 's/^[-+]/ /' "$1"
       
   984   > __EOF__
       
   985   $ chmod +x editor
       
   986   $ HGEDITOR="'`pwd`'"/editor hg record <<EOF
       
   987   > y
       
   988   > e
       
   989   > EOF
       
   990   diff --git a/editedfile b/editedfile
       
   991   1 hunks, 3 lines changed
       
   992   examine changes to 'editedfile'? [Ynesfdaq?] 
       
   993   @@ -1,3 +1,3 @@
       
   994   -This is the first line
       
   995   -This change will be committed
       
   996   -This is the third line
       
   997   +This change will not be committed
       
   998   +This is the second line
       
   999   +This line has been added
       
  1000   record this change to 'editedfile'? [Ynesfdaq?] 
       
  1001   no changes to record
       
  1002   $ cat editedfile
       
  1003   This change will not be committed
       
  1004   This is the second line
       
  1005   This line has been added
       
  1006   $ hg cat -r tip editedfile
       
  1007   This is the first line
       
  1008   This change will be committed
       
  1009   This is the third line
       
  1010   $ hg revert editedfile
       
  1011 
       
  1012 Invalid patch
       
  1013 
       
  1014   $ sed -i -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile
       
  1015   $ echo "This line has been added" >> editedfile
       
  1016   $ cat > editor << '__EOF__'
       
  1017   > #!/bin/sh
       
  1018   > sed -i s/This/That/ "$1"
       
  1019   > __EOF__
       
  1020   $ chmod +x editor
       
  1021   $ HGEDITOR="'`pwd`'"/editor hg record <<EOF
       
  1022   > y
       
  1023   > e
       
  1024   > EOF
       
  1025   diff --git a/editedfile b/editedfile
       
  1026   1 hunks, 3 lines changed
       
  1027   examine changes to 'editedfile'? [Ynesfdaq?] 
       
  1028   @@ -1,3 +1,3 @@
       
  1029   -This is the first line
       
  1030   -This change will be committed
       
  1031   -This is the third line
       
  1032   +This change will not be committed
       
  1033   +This is the second line
       
  1034   +This line has been added
       
  1035   record this change to 'editedfile'? [Ynesfdaq?] 
       
  1036   patching file editedfile
       
  1037   Hunk #1 FAILED at 0
       
  1038   1 out of 1 hunks FAILED -- saving rejects to file editedfile.rej
       
  1039   abort: patch failed to apply
       
  1040   [255]
       
  1041   $ cat editedfile
       
  1042   This change will not be committed
       
  1043   This is the second line
       
  1044   This line has been added
       
  1045   $ hg cat -r tip editedfile
       
  1046   This is the first line
       
  1047   This change will be committed
       
  1048   This is the third line
       
  1049   $ cat editedfile.rej
       
  1050   --- editedfile
       
  1051   +++ editedfile
       
  1052   @@ -1,3 +1,3 @@
       
  1053   -That is the first line
       
  1054   -That change will be committed
       
  1055   -That is the third line
       
  1056   +That change will not be committed
       
  1057   +That is the second line
       
  1058   +That line has been added
       
  1059   $ hg up -C
       
  1060   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   916 
  1061 
   917 With win32text
  1062 With win32text
   918 
  1063 
   919   $ echo '[extensions]' >> .hg/hgrc
  1064   $ echo '[extensions]' >> .hg/hgrc
   920   $ echo 'win32text = ' >> .hg/hgrc
  1065   $ echo 'win32text = ' >> .hg/hgrc
   929 
  1074 
   930   $ echo '[win32text]' >> .hg/hgrc
  1075   $ echo '[win32text]' >> .hg/hgrc
   931   $ echo 'warn = no' >> .hg/hgrc
  1076   $ echo 'warn = no' >> .hg/hgrc
   932 
  1077 
   933   $ echo d >> subdir/f1
  1078   $ echo d >> subdir/f1
   934   $ hg record -d '23 0' -mw1 <<EOF
  1079   $ hg record -d '24 0' -mw1 <<EOF
   935   > y
  1080   > y
   936   > y
  1081   > y
   937   > EOF
  1082   > EOF
   938   diff --git a/subdir/f1 b/subdir/f1
  1083   diff --git a/subdir/f1 b/subdir/f1
   939   1 hunks, 1 lines changed
  1084   1 hunks, 1 lines changed
   940   examine changes to 'subdir/f1'? [Ynsfdaq?] 
  1085   examine changes to 'subdir/f1'? [Ynesfdaq?] 
   941   @@ -3,3 +3,4 @@
  1086   @@ -3,3 +3,4 @@
   942    a
  1087    a
   943    b
  1088    b
   944    c
  1089    c
   945   +d
  1090   +d
   946   record this change to 'subdir/f1'? [Ynsfdaq?] 
  1091   record this change to 'subdir/f1'? [Ynesfdaq?] 
   947 
  1092 
   948   $ hg tip -p
  1093   $ hg tip -p
   949   changeset:   26:b8306e70edc4
  1094   changeset:   28:287ad1f41a72
   950   tag:         tip
  1095   tag:         tip
   951   parent:      24:0b082130c20a
  1096   user:        test
   952   user:        test
  1097   date:        Thu Jan 01 00:00:24 1970 +0000
   953   date:        Thu Jan 01 00:00:23 1970 +0000
       
   954   summary:     w1
  1098   summary:     w1
   955   
  1099   
   956   diff -r 0b082130c20a -r b8306e70edc4 subdir/f1
  1100   diff -r 65ce23a81197 -r 287ad1f41a72 subdir/f1
   957   --- a/subdir/f1	Thu Jan 01 00:00:22 1970 +0000
  1101   --- a/subdir/f1	Thu Jan 01 00:00:23 1970 +0000
   958   +++ b/subdir/f1	Thu Jan 01 00:00:23 1970 +0000
  1102   +++ b/subdir/f1	Thu Jan 01 00:00:24 1970 +0000
   959   @@ -3,3 +3,4 @@
  1103   @@ -3,3 +3,4 @@
   960    a
  1104    a
   961    b
  1105    b
   962    c
  1106    c
   963   +d
  1107   +d