diff options
Diffstat (limited to 'tests/test-record.t')
-rw-r--r-- | tests/test-record.t | 388 |
1 files changed, 64 insertions, 324 deletions
diff --git a/tests/test-record.t b/tests/test-record.t index 833b290..8a697c5 100644 --- a/tests/test-record.t +++ b/tests/test-record.t @@ -18,7 +18,7 @@ Select no files > EOF diff --git a/empty-rw b/empty-rw new file mode 100644 - examine changes to 'empty-rw'? [Ynesfdaq?] + examine changes to 'empty-rw'? [Ynsfdaq?] no changes to record $ hg tip -p @@ -37,7 +37,7 @@ Select files but no hunks > EOF diff --git a/empty-rw b/empty-rw new file mode 100644 - examine changes to 'empty-rw'? [Ynesfdaq?] + examine changes to 'empty-rw'? [Ynsfdaq?] abort: empty commit message [255] @@ -57,7 +57,7 @@ Record empty file > EOF diff --git a/empty-rw b/empty-rw new file mode 100644 - examine changes to 'empty-rw'? [Ynesfdaq?] + examine changes to 'empty-rw'? [Ynsfdaq?] $ hg tip -p changeset: 0:c0708cf4e46e @@ -86,7 +86,7 @@ Rename empty file diff --git a/empty-rw b/empty-rename rename from empty-rw rename to empty-rename - examine changes to 'empty-rw' and 'empty-rename'? [Ynesfdaq?] + examine changes to 'empty-rw' and 'empty-rename'? [Ynsfdaq?] $ hg tip -p changeset: 1:d695e8dcb197 @@ -106,7 +106,7 @@ Copy empty file diff --git a/empty-rename b/empty-copy copy from empty-rename copy to empty-copy - examine changes to 'empty-rename' and 'empty-copy'? [Ynesfdaq?] + examine changes to 'empty-rename' and 'empty-copy'? [Ynsfdaq?] $ hg tip -p changeset: 2:1d4b90bea524 @@ -125,7 +125,7 @@ Delete empty file > EOF diff --git a/empty-copy b/empty-copy deleted file mode 100644 - examine changes to 'empty-copy'? [Ynesfdaq?] + examine changes to 'empty-copy'? [Ynsfdaq?] $ hg tip -p changeset: 3:b39a238f01a1 @@ -147,7 +147,7 @@ Add binary file diff --git a/tip.bundle b/tip.bundle new file mode 100644 this is a binary file - examine changes to 'tip.bundle'? [Ynesfdaq?] + examine changes to 'tip.bundle'? [Ynsfdaq?] $ hg tip -p changeset: 4:ad816da3711e @@ -169,7 +169,7 @@ Change binary file > EOF diff --git a/tip.bundle b/tip.bundle this modifies a binary file (all or nothing) - examine changes to 'tip.bundle'? [Ynesfdaq?] + examine changes to 'tip.bundle'? [Ynsfdaq?] $ hg tip -p changeset: 5:dccd6f3eb485 @@ -194,7 +194,7 @@ Rename and change binary file rename from tip.bundle rename to top.bundle this modifies a binary file (all or nothing) - examine changes to 'tip.bundle' and 'top.bundle'? [Ynesfdaq?] + examine changes to 'tip.bundle' and 'top.bundle'? [Ynsfdaq?] $ hg tip -p changeset: 6:7fa44105f5b3 @@ -222,7 +222,7 @@ Add plain file > EOF diff --git a/plain b/plain new file mode 100644 - examine changes to 'plain'? [Ynesfdaq?] + examine changes to 'plain'? [Ynsfdaq?] $ hg tip -p changeset: 7:11fb457c1be4 @@ -256,13 +256,13 @@ Modify end of plain file > EOF diff --git a/plain b/plain 1 hunks, 1 lines changed - examine changes to 'plain'? [Ynesfdaq?] + examine changes to 'plain'? [Ynsfdaq?] @@ -8,3 +8,4 @@ 8 9 10 +11 - record this change to 'plain'? [Ynesfdaq?] + record this change to 'plain'? [Ynsfdaq?] Modify end of plain file, no EOL @@ -273,14 +273,14 @@ Modify end of plain file, no EOL > EOF diff --git a/plain b/plain 1 hunks, 1 lines changed - examine changes to 'plain'? [Ynesfdaq?] + examine changes to 'plain'? [Ynsfdaq?] @@ -9,3 +9,4 @@ 9 10 11 +7264f99c5f5ff3261504828afa4fb4d406c3af54 \ No newline at end of file - record this change to 'plain'? [Ynesfdaq?] + record this change to 'plain'? [Ynsfdaq?] Modify end of plain file, add EOL @@ -294,7 +294,7 @@ Modify end of plain file, add EOL > EOF diff --git a/plain b/plain 1 hunks, 1 lines changed - examine changes to 'plain'? [Ynesfdaq?] + examine changes to 'plain'? [Ynsfdaq?] @@ -9,4 +9,4 @@ 9 10 @@ -302,10 +302,10 @@ Modify end of plain file, add EOL -7264f99c5f5ff3261504828afa4fb4d406c3af54 \ No newline at end of file +7264f99c5f5ff3261504828afa4fb4d406c3af54 - record change 1/2 to 'plain'? [Ynesfdaq?] + record change 1/2 to 'plain'? [Ynsfdaq?] diff --git a/plain2 b/plain2 new file mode 100644 - examine changes to 'plain2'? [Ynesfdaq?] + examine changes to 'plain2'? [Ynsfdaq?] Modify beginning, trim end, record both, add another file to test changes numbering @@ -325,28 +325,28 @@ changes numbering > EOF diff --git a/plain b/plain 2 hunks, 3 lines changed - examine changes to 'plain'? [Ynesfdaq?] + examine changes to 'plain'? [Ynsfdaq?] @@ -1,4 +1,4 @@ -1 +2 2 3 4 - record change 1/3 to 'plain'? [Ynesfdaq?] + record change 1/3 to 'plain'? [Ynsfdaq?] @@ -8,5 +8,3 @@ 8 9 10 -11 -7264f99c5f5ff3261504828afa4fb4d406c3af54 - record change 2/3 to 'plain'? [Ynesfdaq?] + record change 2/3 to 'plain'? [Ynsfdaq?] diff --git a/plain2 b/plain2 1 hunks, 1 lines changed - examine changes to 'plain2'? [Ynesfdaq?] + examine changes to 'plain2'? [Ynsfdaq?] @@ -1,1 +1,2 @@ 1 +2 - record change 3/3 to 'plain2'? [Ynesfdaq?] + record change 3/3 to 'plain2'? [Ynsfdaq?] $ hg tip -p changeset: 11:21df83db12b8 @@ -394,7 +394,7 @@ Record end > EOF diff --git a/plain b/plain 2 hunks, 4 lines changed - examine changes to 'plain'? [Ynesfdaq?] + examine changes to 'plain'? [Ynsfdaq?] @@ -1,9 +1,6 @@ -2 -2 @@ -405,7 +405,7 @@ Record end 7 8 9 - record change 1/2 to 'plain'? [Ynesfdaq?] + record change 1/2 to 'plain'? [Ynsfdaq?] @@ -4,7 +1,7 @@ 4 5 @@ -415,7 +415,7 @@ Record end 9 -10 +10.new - record change 2/2 to 'plain'? [Ynesfdaq?] + record change 2/2 to 'plain'? [Ynsfdaq?] $ hg tip -p changeset: 12:99337501826f @@ -443,7 +443,7 @@ Record beginning > EOF diff --git a/plain b/plain 1 hunks, 3 lines changed - examine changes to 'plain'? [Ynesfdaq?] + examine changes to 'plain'? [Ynsfdaq?] @@ -1,6 +1,3 @@ -2 -2 @@ -451,7 +451,7 @@ Record beginning 4 5 6 - record this change to 'plain'? [Ynesfdaq?] + record this change to 'plain'? [Ynsfdaq?] $ hg tip -p changeset: 13:bbd45465d540 @@ -488,7 +488,7 @@ Record end > EOF diff --git a/plain b/plain 2 hunks, 4 lines changed - examine changes to 'plain'? [Ynesfdaq?] + examine changes to 'plain'? [Ynsfdaq?] @@ -1,6 +1,9 @@ +1 +2 @@ -499,7 +499,7 @@ Record end 7 8 9 - record change 1/2 to 'plain'? [Ynesfdaq?] + record change 1/2 to 'plain'? [Ynsfdaq?] @@ -1,7 +4,6 @@ 4 5 @@ -508,7 +508,7 @@ Record end 8 9 -10.new - record change 2/2 to 'plain'? [Ynesfdaq?] + record change 2/2 to 'plain'? [Ynsfdaq?] Add to beginning, middle, end @@ -527,14 +527,14 @@ Record beginning, middle > EOF diff --git a/plain b/plain 3 hunks, 7 lines changed - examine changes to 'plain'? [Ynesfdaq?] + examine changes to 'plain'? [Ynsfdaq?] @@ -1,2 +1,5 @@ +1 +2 +3 4 5 - record change 1/3 to 'plain'? [Ynesfdaq?] + record change 1/3 to 'plain'? [Ynsfdaq?] @@ -1,6 +4,8 @@ 4 5 @@ -544,7 +544,7 @@ Record beginning, middle 7 8 9 - record change 2/3 to 'plain'? [Ynesfdaq?] + record change 2/3 to 'plain'? [Ynsfdaq?] @@ -3,4 +8,6 @@ 6 7 @@ -552,7 +552,7 @@ Record beginning, middle 9 +10 +11 - record change 3/3 to 'plain'? [Ynesfdaq?] + record change 3/3 to 'plain'? [Ynsfdaq?] $ hg tip -p changeset: 15:f34a7937ec33 @@ -585,14 +585,14 @@ Record end > EOF diff --git a/plain b/plain 1 hunks, 2 lines changed - examine changes to 'plain'? [Ynesfdaq?] + examine changes to 'plain'? [Ynsfdaq?] @@ -9,3 +9,5 @@ 7 8 9 +10 +11 - record this change to 'plain'? [Ynesfdaq?] + record this change to 'plain'? [Ynsfdaq?] $ hg tip -p changeset: 16:f9900b71a04c @@ -625,11 +625,11 @@ Record end > EOF diff --git a/subdir/a b/subdir/a 1 hunks, 1 lines changed - examine changes to 'subdir/a'? [Ynesfdaq?] + examine changes to 'subdir/a'? [Ynsfdaq?] @@ -1,1 +1,2 @@ a +a - record this change to 'subdir/a'? [Ynesfdaq?] + record this change to 'subdir/a'? [Ynsfdaq?] $ hg tip -p changeset: 18:61be427a9deb @@ -663,17 +663,16 @@ Help, quit > EOF diff --git a/subdir/f1 b/subdir/f1 1 hunks, 1 lines changed - examine changes to 'subdir/f1'? [Ynesfdaq?] + examine changes to 'subdir/f1'? [Ynsfdaq?] y - record this change n - skip this change - e - edit this change manually s - skip remaining changes to this file f - record remaining changes to this file d - done, skip remaining changes and files a - record all changes to all remaining files q - quit, recording no changes ? - display help - examine changes to 'subdir/f1'? [Ynesfdaq?] + examine changes to 'subdir/f1'? [Ynsfdaq?] abort: user quit [255] @@ -684,10 +683,10 @@ Skip > EOF diff --git a/subdir/f1 b/subdir/f1 1 hunks, 1 lines changed - examine changes to 'subdir/f1'? [Ynesfdaq?] + examine changes to 'subdir/f1'? [Ynsfdaq?] diff --git a/subdir/f2 b/subdir/f2 1 hunks, 1 lines changed - examine changes to 'subdir/f2'? [Ynesfdaq?] abort: response expected + examine changes to 'subdir/f2'? [Ynsfdaq?] abort: response expected [255] No @@ -697,10 +696,10 @@ No > EOF diff --git a/subdir/f1 b/subdir/f1 1 hunks, 1 lines changed - examine changes to 'subdir/f1'? [Ynesfdaq?] + examine changes to 'subdir/f1'? [Ynsfdaq?] diff --git a/subdir/f2 b/subdir/f2 1 hunks, 1 lines changed - examine changes to 'subdir/f2'? [Ynesfdaq?] abort: response expected + examine changes to 'subdir/f2'? [Ynsfdaq?] abort: response expected [255] f, quit @@ -711,10 +710,10 @@ f, quit > EOF diff --git a/subdir/f1 b/subdir/f1 1 hunks, 1 lines changed - examine changes to 'subdir/f1'? [Ynesfdaq?] + examine changes to 'subdir/f1'? [Ynsfdaq?] diff --git a/subdir/f2 b/subdir/f2 1 hunks, 1 lines changed - examine changes to 'subdir/f2'? [Ynesfdaq?] + examine changes to 'subdir/f2'? [Ynsfdaq?] abort: user quit [255] @@ -726,10 +725,10 @@ s, all > EOF diff --git a/subdir/f1 b/subdir/f1 1 hunks, 1 lines changed - examine changes to 'subdir/f1'? [Ynesfdaq?] + examine changes to 'subdir/f1'? [Ynsfdaq?] diff --git a/subdir/f2 b/subdir/f2 1 hunks, 1 lines changed - examine changes to 'subdir/f2'? [Ynesfdaq?] + examine changes to 'subdir/f2'? [Ynsfdaq?] $ hg tip -p changeset: 20:b3df3dda369a @@ -753,7 +752,7 @@ f > EOF diff --git a/subdir/f1 b/subdir/f1 1 hunks, 1 lines changed - examine changes to 'subdir/f1'? [Ynesfdaq?] + examine changes to 'subdir/f1'? [Ynsfdaq?] $ hg tip -p changeset: 21:38ec577f126b @@ -770,8 +769,6 @@ f +a -#if execbit - Preserve chmod +x $ chmod +x f1 @@ -785,12 +782,12 @@ Preserve chmod +x old mode 100644 new mode 100755 1 hunks, 1 lines changed - examine changes to 'subdir/f1'? [Ynesfdaq?] + examine changes to 'subdir/f1'? [Ynsfdaq?] @@ -1,2 +1,3 @@ a a +a - record this change to 'subdir/f1'? [Ynesfdaq?] + record this change to 'subdir/f1'? [Ynsfdaq?] $ hg tip --config diff.git=True -p changeset: 22:3261adceb075 @@ -820,13 +817,13 @@ Preserve execute permission on original > EOF diff --git a/subdir/f1 b/subdir/f1 1 hunks, 1 lines changed - examine changes to 'subdir/f1'? [Ynesfdaq?] + examine changes to 'subdir/f1'? [Ynsfdaq?] @@ -1,3 +1,4 @@ a a a +b - record this change to 'subdir/f1'? [Ynesfdaq?] + record this change to 'subdir/f1'? [Ynsfdaq?] $ hg tip --config diff.git=True -p changeset: 23:b429867550db @@ -858,13 +855,13 @@ Preserve chmod -x old mode 100755 new mode 100644 1 hunks, 1 lines changed - examine changes to 'subdir/f1'? [Ynesfdaq?] + examine changes to 'subdir/f1'? [Ynsfdaq?] @@ -2,3 +2,4 @@ a a b +c - record this change to 'subdir/f1'? [Ynesfdaq?] + record this change to 'subdir/f1'? [Ynsfdaq?] $ hg tip --config diff.git=True -p changeset: 24:0b082130c20a @@ -885,120 +882,8 @@ Preserve chmod -x +c -#else - -Slightly bogus tests to get almost same repo structure as when x bit is used -- but with different hashes. - -Mock "Preserve chmod +x" - - $ echo a >> f1 - $ hg record -d '20 0' -mz <<EOF - > y - > y - > y - > EOF - diff --git a/subdir/f1 b/subdir/f1 - 1 hunks, 1 lines changed - examine changes to 'subdir/f1'? [Ynesfdaq?] - @@ -1,2 +1,3 @@ - a - a - +a - record this change to 'subdir/f1'? [Ynesfdaq?] - - $ hg tip --config diff.git=True -p - changeset: 22:0d463bd428f5 - tag: tip - user: test - date: Thu Jan 01 00:00:20 1970 +0000 - summary: z - - diff --git a/subdir/f1 b/subdir/f1 - --- a/subdir/f1 - +++ b/subdir/f1 - @@ -1,2 +1,3 @@ - a - a - +a - - -Mock "Preserve execute permission on original" - - $ echo b >> f1 - $ hg record -d '21 0' -maa <<EOF - > y - > y - > y - > EOF - diff --git a/subdir/f1 b/subdir/f1 - 1 hunks, 1 lines changed - examine changes to 'subdir/f1'? [Ynesfdaq?] - @@ -1,3 +1,4 @@ - a - a - a - +b - record this change to 'subdir/f1'? [Ynesfdaq?] - - $ hg tip --config diff.git=True -p - changeset: 23:0eab41a3e524 - tag: tip - user: test - date: Thu Jan 01 00:00:21 1970 +0000 - summary: aa - - diff --git a/subdir/f1 b/subdir/f1 - --- a/subdir/f1 - +++ b/subdir/f1 - @@ -1,3 +1,4 @@ - a - a - a - +b - - -Mock "Preserve chmod -x" - - $ chmod -x f1 - $ echo c >> f1 - $ hg record -d '22 0' -mab <<EOF - > y - > y - > y - > EOF - diff --git a/subdir/f1 b/subdir/f1 - 1 hunks, 1 lines changed - examine changes to 'subdir/f1'? [Ynesfdaq?] - @@ -2,3 +2,4 @@ - a - a - b - +c - record this change to 'subdir/f1'? [Ynesfdaq?] - - $ hg tip --config diff.git=True -p - changeset: 24:f4f718f27b7c - tag: tip - user: test - date: Thu Jan 01 00:00:22 1970 +0000 - summary: ab - - diff --git a/subdir/f1 b/subdir/f1 - --- a/subdir/f1 - +++ b/subdir/f1 - @@ -2,3 +2,4 @@ - a - a - b - +c - - -#endif - $ cd .. - Abort early when a merge is in progress $ hg up 4 @@ -1009,7 +894,6 @@ Abort early when a merge is in progress $ hg branch thatbranch marked working directory as branch thatbranch - (branches are permanent and global, did you want a bookmark?) $ hg ci -m'new head' @@ -1027,149 +911,6 @@ Abort early when a merge is in progress $ hg up -C 0 files updated, 0 files merged, 1 files removed, 0 files unresolved -Editing patch - - $ cat > editor.sh << '__EOF__' - > sed -e 7d -e '5s/^-/ /' "$1" > tmp - > mv tmp "$1" - > __EOF__ - $ cat > editedfile << '__EOF__' - > This is the first line - > This is the second line - > This is the third line - > __EOF__ - $ hg add editedfile - $ hg commit -medit-patch-1 - $ cat > editedfile << '__EOF__' - > This line has changed - > This change will be committed - > This is the third line - > __EOF__ - $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record -d '23 0' -medit-patch-2 <<EOF - > y - > e - > EOF - diff --git a/editedfile b/editedfile - 1 hunks, 2 lines changed - examine changes to 'editedfile'? [Ynesfdaq?] - @@ -1,3 +1,3 @@ - -This is the first line - -This is the second line - +This line has changed - +This change will be committed - This is the third line - record this change to 'editedfile'? [Ynesfdaq?] - $ cat editedfile - This line has changed - This change will be committed - This is the third line - $ hg cat -r tip editedfile - This is the first line - This change will be committed - This is the third line - $ hg revert editedfile - -Trying to edit patch for whole file - - $ echo "This is the fourth line" >> editedfile - $ hg record <<EOF - > e - > q - > EOF - diff --git a/editedfile b/editedfile - 1 hunks, 1 lines changed - examine changes to 'editedfile'? [Ynesfdaq?] - cannot edit patch for whole file - examine changes to 'editedfile'? [Ynesfdaq?] - abort: user quit - [255] - $ hg revert editedfile - -Removing changes from patch - - $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp - $ mv tmp editedfile - $ echo "This line has been added" >> editedfile - $ cat > editor.sh << '__EOF__' - > sed -e 's/^[-+]/ /' "$1" > tmp - > mv tmp "$1" - > __EOF__ - $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record <<EOF - > y - > e - > EOF - diff --git a/editedfile b/editedfile - 1 hunks, 3 lines changed - examine changes to 'editedfile'? [Ynesfdaq?] - @@ -1,3 +1,3 @@ - -This is the first line - -This change will be committed - -This is the third line - +This change will not be committed - +This is the second line - +This line has been added - record this change to 'editedfile'? [Ynesfdaq?] - no changes to record - $ cat editedfile - This change will not be committed - This is the second line - This line has been added - $ hg cat -r tip editedfile - This is the first line - This change will be committed - This is the third line - $ hg revert editedfile - -Invalid patch - - $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp - $ mv tmp editedfile - $ echo "This line has been added" >> editedfile - $ cat > editor.sh << '__EOF__' - > sed s/This/That/ "$1" > tmp - > mv tmp "$1" - > __EOF__ - $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record <<EOF - > y - > e - > EOF - diff --git a/editedfile b/editedfile - 1 hunks, 3 lines changed - examine changes to 'editedfile'? [Ynesfdaq?] - @@ -1,3 +1,3 @@ - -This is the first line - -This change will be committed - -This is the third line - +This change will not be committed - +This is the second line - +This line has been added - record this change to 'editedfile'? [Ynesfdaq?] - patching file editedfile - Hunk #1 FAILED at 0 - 1 out of 1 hunks FAILED -- saving rejects to file editedfile.rej - abort: patch failed to apply - [255] - $ cat editedfile - This change will not be committed - This is the second line - This line has been added - $ hg cat -r tip editedfile - This is the first line - This change will be committed - This is the third line - $ cat editedfile.rej - --- editedfile - +++ editedfile - @@ -1,3 +1,3 @@ - -That is the first line - -That change will be committed - -That is the third line - +That change will not be committed - +That is the second line - +That line has been added - $ hg up -C - 1 files updated, 0 files merged, 0 files removed, 0 files unresolved - With win32text $ echo '[extensions]' >> .hg/hgrc @@ -1187,35 +928,34 @@ Ignore win32text deprecation warning for now: $ echo 'warn = no' >> .hg/hgrc $ echo d >> subdir/f1 - $ hg record -d '24 0' -mw1 <<EOF + $ hg record -d '23 0' -mw1 <<EOF > y > y > EOF diff --git a/subdir/f1 b/subdir/f1 1 hunks, 1 lines changed - examine changes to 'subdir/f1'? [Ynesfdaq?] + examine changes to 'subdir/f1'? [Ynsfdaq?] @@ -3,3 +3,4 @@ a b c +d - record this change to 'subdir/f1'? [Ynesfdaq?] + record this change to 'subdir/f1'? [Ynsfdaq?] $ hg tip -p - changeset: 28:* (glob) + changeset: 26:b8306e70edc4 tag: tip + parent: 24:0b082130c20a user: test - date: Thu Jan 01 00:00:24 1970 +0000 + date: Thu Jan 01 00:00:23 1970 +0000 summary: w1 - diff -r ???????????? -r ???????????? subdir/f1 (glob) - --- a/subdir/f1 Thu Jan 01 00:00:23 1970 +0000 - +++ b/subdir/f1 Thu Jan 01 00:00:24 1970 +0000 + diff -r 0b082130c20a -r b8306e70edc4 subdir/f1 + --- a/subdir/f1 Thu Jan 01 00:00:22 1970 +0000 + +++ b/subdir/f1 Thu Jan 01 00:00:23 1970 +0000 @@ -3,3 +3,4 @@ a b c +d - - $ cd .. |