Fossil SCM
Remove duplicated and unused variables, create shared helpers for calling the fossil binary consistently from all tests.
Commit
123dee37b393735326234f46cb754c15a2cc5ef8c441f59d28449dd3d1f033c3
Parent
6862ed1333dc1c3…
19 files changed
+3
-6
+3
-14
+1
-3
+2
-2
+9
-23
+1
-1
+2
-6
+16
-48
+2
-11
+3
-9
+2
-6
+2
-6
+2
-6
+1
-3
+38
-9
+3
-5
+2
-3
+1
-2
+2
-6
~
test/amend.test
~
test/branch-tag.test
~
test/clean.test
~
test/commit-warning.test
~
test/merge-history.test
~
test/merge5.test
~
test/merge6.test
~
test/merge_renames.test
~
test/merge_renames_2.test
~
test/merge_warn.test
~
test/revert.test
~
test/roundtrip.test
~
test/set-manifest.test
~
test/stash.test
~
test/tester.tcl
~
test/th1-docs.test
~
test/th1-hooks.test
~
test/unversioned.test
~
test/update.test
+3
-6
| --- test/amend.test | ||
| +++ test/amend.test | ||
| @@ -53,13 +53,11 @@ | ||
| 53 | 53 | |
| 54 | 54 | if {![uuid_from_checkout HASHINIT]} { |
| 55 | 55 | test_fail_then_return amend-checkout-failure \ |
| 56 | 56 | "could not read the check-out's hash" |
| 57 | 57 | } |
| 58 | -write_file datafile "data" | |
| 59 | -fossil add datafile | |
| 60 | -fossil commit -m "c1" | |
| 58 | +commit_file datafile "data" "c1" | |
| 61 | 59 | if {![uuid_from_commit $RESULT HASH]} { |
| 62 | 60 | test_fail_then_return amend-setup-failure \ |
| 63 | 61 | "could not read the hash of the first commit: $RESULT" |
| 64 | 62 | } |
| 65 | 63 | |
| @@ -356,11 +354,11 @@ | ||
| 356 | 354 | if {$VERBOSE} { protOut "No artifact found in timeline output: $RESULT" } |
| 357 | 355 | test amend-comment-$name.2 false |
| 358 | 356 | } |
| 359 | 357 | fossil timeline -n 1 |
| 360 | 358 | test amend-comment-$name.3 { |
| 361 | - [string match "*[short_uuid $HASH]*Edit*check-in*comment.*" $RESULT] | |
| 359 | + [string match "*[string range $HASH 0 9]*Edit*check-in*comment.*" $RESULT] | |
| 362 | 360 | } |
| 363 | 361 | fossil info $HASH |
| 364 | 362 | test amend-comment-$name.4 { |
| 365 | 363 | [string match "*hash:*$HASH*comment:*$comment*" $RESULT] |
| 366 | 364 | } |
| @@ -383,12 +381,11 @@ | ||
| 383 | 381 | write_file commitmsg "revision 4 revised with -M" |
| 384 | 382 | fossil amend $HASH -M commitmsg |
| 385 | 383 | test-comment 4 $HASH "revision 4 revised with -M" |
| 386 | 384 | |
| 387 | 385 | prep-test "final comment" "final content" |
| 388 | -fossil settings editor [appendArgs \ | |
| 389 | - [info nameofexecutable] " " [file join $testfiledir fake-editor.tcl]] | |
| 386 | +fossil settings editor [fake_editor_command] | |
| 390 | 387 | set comment "interactive edited comment" |
| 391 | 388 | set env(FAKE_EDITOR_SCRIPT) [list set data $comment] |
| 392 | 389 | fossil amend $HASH --edit-comment |
| 393 | 390 | unset env(FAKE_EDITOR_SCRIPT) |
| 394 | 391 | test-comment 5 $HASH $comment |
| 395 | 392 |
| --- test/amend.test | |
| +++ test/amend.test | |
| @@ -53,13 +53,11 @@ | |
| 53 | |
| 54 | if {![uuid_from_checkout HASHINIT]} { |
| 55 | test_fail_then_return amend-checkout-failure \ |
| 56 | "could not read the check-out's hash" |
| 57 | } |
| 58 | write_file datafile "data" |
| 59 | fossil add datafile |
| 60 | fossil commit -m "c1" |
| 61 | if {![uuid_from_commit $RESULT HASH]} { |
| 62 | test_fail_then_return amend-setup-failure \ |
| 63 | "could not read the hash of the first commit: $RESULT" |
| 64 | } |
| 65 | |
| @@ -356,11 +354,11 @@ | |
| 356 | if {$VERBOSE} { protOut "No artifact found in timeline output: $RESULT" } |
| 357 | test amend-comment-$name.2 false |
| 358 | } |
| 359 | fossil timeline -n 1 |
| 360 | test amend-comment-$name.3 { |
| 361 | [string match "*[short_uuid $HASH]*Edit*check-in*comment.*" $RESULT] |
| 362 | } |
| 363 | fossil info $HASH |
| 364 | test amend-comment-$name.4 { |
| 365 | [string match "*hash:*$HASH*comment:*$comment*" $RESULT] |
| 366 | } |
| @@ -383,12 +381,11 @@ | |
| 383 | write_file commitmsg "revision 4 revised with -M" |
| 384 | fossil amend $HASH -M commitmsg |
| 385 | test-comment 4 $HASH "revision 4 revised with -M" |
| 386 | |
| 387 | prep-test "final comment" "final content" |
| 388 | fossil settings editor [appendArgs \ |
| 389 | [info nameofexecutable] " " [file join $testfiledir fake-editor.tcl]] |
| 390 | set comment "interactive edited comment" |
| 391 | set env(FAKE_EDITOR_SCRIPT) [list set data $comment] |
| 392 | fossil amend $HASH --edit-comment |
| 393 | unset env(FAKE_EDITOR_SCRIPT) |
| 394 | test-comment 5 $HASH $comment |
| 395 |
| --- test/amend.test | |
| +++ test/amend.test | |
| @@ -53,13 +53,11 @@ | |
| 53 | |
| 54 | if {![uuid_from_checkout HASHINIT]} { |
| 55 | test_fail_then_return amend-checkout-failure \ |
| 56 | "could not read the check-out's hash" |
| 57 | } |
| 58 | commit_file datafile "data" "c1" |
| 59 | if {![uuid_from_commit $RESULT HASH]} { |
| 60 | test_fail_then_return amend-setup-failure \ |
| 61 | "could not read the hash of the first commit: $RESULT" |
| 62 | } |
| 63 | |
| @@ -356,11 +354,11 @@ | |
| 354 | if {$VERBOSE} { protOut "No artifact found in timeline output: $RESULT" } |
| 355 | test amend-comment-$name.2 false |
| 356 | } |
| 357 | fossil timeline -n 1 |
| 358 | test amend-comment-$name.3 { |
| 359 | [string match "*[string range $HASH 0 9]*Edit*check-in*comment.*" $RESULT] |
| 360 | } |
| 361 | fossil info $HASH |
| 362 | test amend-comment-$name.4 { |
| 363 | [string match "*hash:*$HASH*comment:*$comment*" $RESULT] |
| 364 | } |
| @@ -383,12 +381,11 @@ | |
| 381 | write_file commitmsg "revision 4 revised with -M" |
| 382 | fossil amend $HASH -M commitmsg |
| 383 | test-comment 4 $HASH "revision 4 revised with -M" |
| 384 | |
| 385 | prep-test "final comment" "final content" |
| 386 | fossil settings editor [fake_editor_command] |
| 387 | set comment "interactive edited comment" |
| 388 | set env(FAKE_EDITOR_SCRIPT) [list set data $comment] |
| 389 | fossil amend $HASH --edit-comment |
| 390 | unset env(FAKE_EDITOR_SCRIPT) |
| 391 | test-comment 5 $HASH $comment |
| 392 |
+3
-14
| --- test/branch-tag.test | ||
| +++ test/branch-tag.test | ||
| @@ -21,19 +21,10 @@ | ||
| 21 | 21 | |
| 22 | 22 | set path [file dirname [info script]] |
| 23 | 23 | |
| 24 | 24 | require_no_open_checkout |
| 25 | 25 | |
| 26 | -# Returns the hash of the check-in of the open repository whose comment | |
| 27 | -# is COMMENT. | |
| 28 | -# | |
| 29 | -proc branchtag_hash {comment} { | |
| 30 | - fossil timeline -t ci -n 0 -F {%H %c} | |
| 31 | - regexp -line "^(\[0-9a-f\]+) $comment\$" $::RESULT -> hash | |
| 32 | - return $hash | |
| 33 | -} | |
| 34 | - | |
| 35 | 26 | # Returns the hash of the current check-out. |
| 36 | 27 | # |
| 37 | 28 | proc branchtag_current {} { |
| 38 | 29 | fossil timeline before current -n 1 -t ci -F %H |
| 39 | 30 | return [first_data_line] |
| @@ -50,17 +41,15 @@ | ||
| 50 | 41 | return [lsort $lines] |
| 51 | 42 | } |
| 52 | 43 | |
| 53 | 44 | test_setup |
| 54 | 45 | |
| 55 | -write_file a.txt "a\n" | |
| 56 | -fossil add a.txt | |
| 57 | -fossil commit -m "bt-c1" | |
| 58 | -set c1 [branchtag_hash bt-c1] | |
| 46 | +commit_file a.txt "a\n" "bt-c1" | |
| 47 | +set c1 [checkin_hash bt-c1] | |
| 59 | 48 | write_file a.txt "a2\n" |
| 60 | 49 | fossil commit -m "bt-c2" |
| 61 | -set c2 [branchtag_hash bt-c2] | |
| 50 | +set c2 [checkin_hash bt-c2] | |
| 62 | 51 | |
| 63 | 52 | ############################################################################### |
| 64 | 53 | # |
| 65 | 54 | # A new branch is listed as open, and a check-in on it stays on it. |
| 66 | 55 | # |
| 67 | 56 |
| --- test/branch-tag.test | |
| +++ test/branch-tag.test | |
| @@ -21,19 +21,10 @@ | |
| 21 | |
| 22 | set path [file dirname [info script]] |
| 23 | |
| 24 | require_no_open_checkout |
| 25 | |
| 26 | # Returns the hash of the check-in of the open repository whose comment |
| 27 | # is COMMENT. |
| 28 | # |
| 29 | proc branchtag_hash {comment} { |
| 30 | fossil timeline -t ci -n 0 -F {%H %c} |
| 31 | regexp -line "^(\[0-9a-f\]+) $comment\$" $::RESULT -> hash |
| 32 | return $hash |
| 33 | } |
| 34 | |
| 35 | # Returns the hash of the current check-out. |
| 36 | # |
| 37 | proc branchtag_current {} { |
| 38 | fossil timeline before current -n 1 -t ci -F %H |
| 39 | return [first_data_line] |
| @@ -50,17 +41,15 @@ | |
| 50 | return [lsort $lines] |
| 51 | } |
| 52 | |
| 53 | test_setup |
| 54 | |
| 55 | write_file a.txt "a\n" |
| 56 | fossil add a.txt |
| 57 | fossil commit -m "bt-c1" |
| 58 | set c1 [branchtag_hash bt-c1] |
| 59 | write_file a.txt "a2\n" |
| 60 | fossil commit -m "bt-c2" |
| 61 | set c2 [branchtag_hash bt-c2] |
| 62 | |
| 63 | ############################################################################### |
| 64 | # |
| 65 | # A new branch is listed as open, and a check-in on it stays on it. |
| 66 | # |
| 67 |
| --- test/branch-tag.test | |
| +++ test/branch-tag.test | |
| @@ -21,19 +21,10 @@ | |
| 21 | |
| 22 | set path [file dirname [info script]] |
| 23 | |
| 24 | require_no_open_checkout |
| 25 | |
| 26 | # Returns the hash of the current check-out. |
| 27 | # |
| 28 | proc branchtag_current {} { |
| 29 | fossil timeline before current -n 1 -t ci -F %H |
| 30 | return [first_data_line] |
| @@ -50,17 +41,15 @@ | |
| 41 | return [lsort $lines] |
| 42 | } |
| 43 | |
| 44 | test_setup |
| 45 | |
| 46 | commit_file a.txt "a\n" "bt-c1" |
| 47 | set c1 [checkin_hash bt-c1] |
| 48 | write_file a.txt "a2\n" |
| 49 | fossil commit -m "bt-c2" |
| 50 | set c2 [checkin_hash bt-c2] |
| 51 | |
| 52 | ############################################################################### |
| 53 | # |
| 54 | # A new branch is listed as open, and a check-in on it stays on it. |
| 55 | # |
| 56 |
+1
-3
| --- test/clean.test | ||
| +++ test/clean.test | ||
| @@ -25,13 +25,11 @@ | ||
| 25 | 25 | fossil extra |
| 26 | 26 | test clean-0 {[normalize_result] eq {}} |
| 27 | 27 | |
| 28 | 28 | ############################################################################### |
| 29 | 29 | |
| 30 | -write_file f1 "f1 line" | |
| 31 | -fossil add f1 | |
| 32 | -fossil commit -m "base file" | |
| 30 | +commit_file f1 "f1 line" "base file" | |
| 33 | 31 | fossil ls |
| 34 | 32 | test clean-1 {[normalize_result] eq {f1}} |
| 35 | 33 | |
| 36 | 34 | ############################################################################### |
| 37 | 35 | |
| 38 | 36 |
| --- test/clean.test | |
| +++ test/clean.test | |
| @@ -25,13 +25,11 @@ | |
| 25 | fossil extra |
| 26 | test clean-0 {[normalize_result] eq {}} |
| 27 | |
| 28 | ############################################################################### |
| 29 | |
| 30 | write_file f1 "f1 line" |
| 31 | fossil add f1 |
| 32 | fossil commit -m "base file" |
| 33 | fossil ls |
| 34 | test clean-1 {[normalize_result] eq {f1}} |
| 35 | |
| 36 | ############################################################################### |
| 37 | |
| 38 |
| --- test/clean.test | |
| +++ test/clean.test | |
| @@ -25,13 +25,11 @@ | |
| 25 | fossil extra |
| 26 | test clean-0 {[normalize_result] eq {}} |
| 27 | |
| 28 | ############################################################################### |
| 29 | |
| 30 | commit_file f1 "f1 line" "base file" |
| 31 | fossil ls |
| 32 | test clean-1 {[normalize_result] eq {f1}} |
| 33 | |
| 34 | ############################################################################### |
| 35 | |
| 36 |
+2
-2
| --- test/commit-warning.test | ||
| +++ test/commit-warning.test | ||
| @@ -100,12 +100,12 @@ | ||
| 100 | 100 | set bomBE "\xfe\xff" |
| 101 | 101 | write_file utf-16le-bomle-hello "$bomLE$hello16LE" |
| 102 | 102 | write_file utf-16be-bombe-hello "$bomBE$hello16BE" |
| 103 | 103 | write_file utf-16le-bombe-hello "$bomBE$hello16LE" |
| 104 | 104 | write_file utf-16be-bomle-hello "$bomLE$hello16BE" |
| 105 | -set le16 [read_file [file join $testdir utf16le.txt]] | |
| 106 | -set be16 [read_file [file join $testdir utf16be.txt]] | |
| 105 | +set le16 [read_file [file join $testfiledir utf16le.txt]] | |
| 106 | +set be16 [read_file [file join $testfiledir utf16be.txt]] | |
| 107 | 107 | write_file utf-16le.txt $le16 |
| 108 | 108 | write_file utf-16be.txt $be16 |
| 109 | 109 | write_file utf-nobom-16le.txt [string range $le16 2 end] |
| 110 | 110 | write_file utf-nobom-16be.txt [string range $be16 2 end] |
| 111 | 111 | #write_file [file join $::env(TEMP) utf-nobom-16le.txt] [string range $le16 2 end] |
| 112 | 112 |
| --- test/commit-warning.test | |
| +++ test/commit-warning.test | |
| @@ -100,12 +100,12 @@ | |
| 100 | set bomBE "\xfe\xff" |
| 101 | write_file utf-16le-bomle-hello "$bomLE$hello16LE" |
| 102 | write_file utf-16be-bombe-hello "$bomBE$hello16BE" |
| 103 | write_file utf-16le-bombe-hello "$bomBE$hello16LE" |
| 104 | write_file utf-16be-bomle-hello "$bomLE$hello16BE" |
| 105 | set le16 [read_file [file join $testdir utf16le.txt]] |
| 106 | set be16 [read_file [file join $testdir utf16be.txt]] |
| 107 | write_file utf-16le.txt $le16 |
| 108 | write_file utf-16be.txt $be16 |
| 109 | write_file utf-nobom-16le.txt [string range $le16 2 end] |
| 110 | write_file utf-nobom-16be.txt [string range $be16 2 end] |
| 111 | #write_file [file join $::env(TEMP) utf-nobom-16le.txt] [string range $le16 2 end] |
| 112 |
| --- test/commit-warning.test | |
| +++ test/commit-warning.test | |
| @@ -100,12 +100,12 @@ | |
| 100 | set bomBE "\xfe\xff" |
| 101 | write_file utf-16le-bomle-hello "$bomLE$hello16LE" |
| 102 | write_file utf-16be-bombe-hello "$bomBE$hello16BE" |
| 103 | write_file utf-16le-bombe-hello "$bomBE$hello16LE" |
| 104 | write_file utf-16be-bomle-hello "$bomLE$hello16BE" |
| 105 | set le16 [read_file [file join $testfiledir utf16le.txt]] |
| 106 | set be16 [read_file [file join $testfiledir utf16be.txt]] |
| 107 | write_file utf-16le.txt $le16 |
| 108 | write_file utf-16be.txt $be16 |
| 109 | write_file utf-nobom-16le.txt [string range $le16 2 end] |
| 110 | write_file utf-nobom-16be.txt [string range $be16 2 end] |
| 111 | #write_file [file join $::env(TEMP) utf-nobom-16le.txt] [string range $le16 2 end] |
| 112 |
+9
-23
| --- test/merge-history.test | ||
| +++ test/merge-history.test | ||
| @@ -23,20 +23,10 @@ | ||
| 23 | 23 | |
| 24 | 24 | set path [file dirname [info script]] |
| 25 | 25 | |
| 26 | 26 | require_no_open_checkout |
| 27 | 27 | |
| 28 | -# Returns the hash of the check-in of the open repository whose comment | |
| 29 | -# is COMMENT. | |
| 30 | -# | |
| 31 | -proc mergehist_hash {comment} { | |
| 32 | - fossil timeline -t ci -n 0 -F {%H %c} | |
| 33 | - regexp -line "^(\[0-9a-f\]+) [string map {. \\.} $comment]\$" \ | |
| 34 | - $::RESULT -> hash | |
| 35 | - return $hash | |
| 36 | -} | |
| 37 | - | |
| 38 | 28 | # Returns the P-card and Q-cards of the manifest of CHECKIN as a list of |
| 39 | 29 | # lines. |
| 40 | 30 | # |
| 41 | 31 | proc mergehist_cards {checkin} { |
| 42 | 32 | fossil artifact $checkin |
| @@ -56,28 +46,24 @@ | ||
| 56 | 46 | return $lines |
| 57 | 47 | } |
| 58 | 48 | |
| 59 | 49 | test_setup |
| 60 | 50 | |
| 61 | -write_file a.txt "1\n2\n3\n4\n5\n" | |
| 62 | -fossil add a.txt | |
| 63 | -fossil commit -m "mh-c1" --user-override alice | |
| 64 | -set c1 [mergehist_hash mh-c1] | |
| 51 | +commit_file a.txt "1\n2\n3\n4\n5\n" "mh-c1" --user-override alice | |
| 52 | +set c1 [checkin_hash mh-c1] | |
| 65 | 53 | |
| 66 | 54 | write_file a.txt "1\n2-trunk\n3\n4\n5\n" |
| 67 | 55 | fossil commit -m "mh-c2" --user-override bob |
| 68 | -set c2 [mergehist_hash mh-c2] | |
| 56 | +set c2 [checkin_hash mh-c2] | |
| 69 | 57 | |
| 70 | 58 | fossil update $c1 |
| 71 | 59 | write_file a.txt "1\n2\n3\n4-feature\n5\n" |
| 72 | 60 | fossil commit -m "mh-f1" --branch mh-feature --user-override carol |
| 73 | -set f1 [mergehist_hash mh-f1] | |
| 61 | +set f1 [checkin_hash mh-f1] | |
| 74 | 62 | write_file a.txt "1\n2\n3\n4-feature\n5\n6-feature\n" |
| 75 | -write_file g.txt "g\n" | |
| 76 | -fossil add g.txt | |
| 77 | -fossil commit -m "mh-f2" --user-override carol | |
| 78 | -set f2 [mergehist_hash mh-f2] | |
| 63 | +commit_file g.txt "g\n" "mh-f2" --user-override carol | |
| 64 | +set f2 [checkin_hash mh-f2] | |
| 79 | 65 | |
| 80 | 66 | ############################################################################### |
| 81 | 67 | # |
| 82 | 68 | # "fossil merge --cherrypick" applies the changes of one check-in: the |
| 83 | 69 | # edit of f1 and not the line and file that f2 adds. The check-in that |
| @@ -84,11 +70,11 @@ | ||
| 84 | 70 | # follows has one parent and a Q-card "+F1". |
| 85 | 71 | # |
| 86 | 72 | fossil update trunk |
| 87 | 73 | fossil merge --cherrypick $f1 |
| 88 | 74 | fossil commit -m "mh-pick" --user-override dave |
| 89 | -set pick [mergehist_hash mh-pick] | |
| 75 | +set pick [checkin_hash mh-pick] | |
| 90 | 76 | |
| 91 | 77 | test_eq merge-history-cherrypick-content [read_file a.txt] \ |
| 92 | 78 | "1\n2-trunk\n3\n4-feature\n5\n" |
| 93 | 79 | test_eq merge-history-cherrypick-no-g [file exists g.txt] 0 |
| 94 | 80 | test_eq merge-history-cherrypick-cards [mergehist_cards $pick] \ |
| @@ -101,11 +87,11 @@ | ||
| 101 | 87 | # Q-card "-C2". A backout of the parent itself is recorded without a |
| 102 | 88 | # Q-card, so these tests back out an earlier check-in. |
| 103 | 89 | # |
| 104 | 90 | fossil merge --backout $c2 |
| 105 | 91 | fossil commit -m "mh-backout" --user-override erin |
| 106 | -set backout [mergehist_hash mh-backout] | |
| 92 | +set backout [checkin_hash mh-backout] | |
| 107 | 93 | |
| 108 | 94 | test_eq merge-history-backout-content [read_file a.txt] \ |
| 109 | 95 | "1\n2\n3\n4-feature\n5\n" |
| 110 | 96 | test_eq merge-history-backout-cards [mergehist_cards $backout] \ |
| 111 | 97 | [list "P $pick" "Q -$c2"] |
| @@ -115,11 +101,11 @@ | ||
| 115 | 101 | # A full merge of the branch brings in both of its check-ins, and the |
| 116 | 102 | # check-in that follows has two parents. |
| 117 | 103 | # |
| 118 | 104 | fossil merge mh-feature |
| 119 | 105 | fossil commit -m "mh-merge" --user-override frank |
| 120 | -set merge [mergehist_hash mh-merge] | |
| 106 | +set merge [checkin_hash mh-merge] | |
| 121 | 107 | |
| 122 | 108 | test_eq merge-history-merge-content [read_file a.txt] \ |
| 123 | 109 | "1\n2\n3\n4-feature\n5\n6-feature\n" |
| 124 | 110 | test_eq merge-history-merge-g [read_file g.txt] "g\n" |
| 125 | 111 | test_eq merge-history-merge-cards [mergehist_cards $merge] \ |
| 126 | 112 |
| --- test/merge-history.test | |
| +++ test/merge-history.test | |
| @@ -23,20 +23,10 @@ | |
| 23 | |
| 24 | set path [file dirname [info script]] |
| 25 | |
| 26 | require_no_open_checkout |
| 27 | |
| 28 | # Returns the hash of the check-in of the open repository whose comment |
| 29 | # is COMMENT. |
| 30 | # |
| 31 | proc mergehist_hash {comment} { |
| 32 | fossil timeline -t ci -n 0 -F {%H %c} |
| 33 | regexp -line "^(\[0-9a-f\]+) [string map {. \\.} $comment]\$" \ |
| 34 | $::RESULT -> hash |
| 35 | return $hash |
| 36 | } |
| 37 | |
| 38 | # Returns the P-card and Q-cards of the manifest of CHECKIN as a list of |
| 39 | # lines. |
| 40 | # |
| 41 | proc mergehist_cards {checkin} { |
| 42 | fossil artifact $checkin |
| @@ -56,28 +46,24 @@ | |
| 56 | return $lines |
| 57 | } |
| 58 | |
| 59 | test_setup |
| 60 | |
| 61 | write_file a.txt "1\n2\n3\n4\n5\n" |
| 62 | fossil add a.txt |
| 63 | fossil commit -m "mh-c1" --user-override alice |
| 64 | set c1 [mergehist_hash mh-c1] |
| 65 | |
| 66 | write_file a.txt "1\n2-trunk\n3\n4\n5\n" |
| 67 | fossil commit -m "mh-c2" --user-override bob |
| 68 | set c2 [mergehist_hash mh-c2] |
| 69 | |
| 70 | fossil update $c1 |
| 71 | write_file a.txt "1\n2\n3\n4-feature\n5\n" |
| 72 | fossil commit -m "mh-f1" --branch mh-feature --user-override carol |
| 73 | set f1 [mergehist_hash mh-f1] |
| 74 | write_file a.txt "1\n2\n3\n4-feature\n5\n6-feature\n" |
| 75 | write_file g.txt "g\n" |
| 76 | fossil add g.txt |
| 77 | fossil commit -m "mh-f2" --user-override carol |
| 78 | set f2 [mergehist_hash mh-f2] |
| 79 | |
| 80 | ############################################################################### |
| 81 | # |
| 82 | # "fossil merge --cherrypick" applies the changes of one check-in: the |
| 83 | # edit of f1 and not the line and file that f2 adds. The check-in that |
| @@ -84,11 +70,11 @@ | |
| 84 | # follows has one parent and a Q-card "+F1". |
| 85 | # |
| 86 | fossil update trunk |
| 87 | fossil merge --cherrypick $f1 |
| 88 | fossil commit -m "mh-pick" --user-override dave |
| 89 | set pick [mergehist_hash mh-pick] |
| 90 | |
| 91 | test_eq merge-history-cherrypick-content [read_file a.txt] \ |
| 92 | "1\n2-trunk\n3\n4-feature\n5\n" |
| 93 | test_eq merge-history-cherrypick-no-g [file exists g.txt] 0 |
| 94 | test_eq merge-history-cherrypick-cards [mergehist_cards $pick] \ |
| @@ -101,11 +87,11 @@ | |
| 101 | # Q-card "-C2". A backout of the parent itself is recorded without a |
| 102 | # Q-card, so these tests back out an earlier check-in. |
| 103 | # |
| 104 | fossil merge --backout $c2 |
| 105 | fossil commit -m "mh-backout" --user-override erin |
| 106 | set backout [mergehist_hash mh-backout] |
| 107 | |
| 108 | test_eq merge-history-backout-content [read_file a.txt] \ |
| 109 | "1\n2\n3\n4-feature\n5\n" |
| 110 | test_eq merge-history-backout-cards [mergehist_cards $backout] \ |
| 111 | [list "P $pick" "Q -$c2"] |
| @@ -115,11 +101,11 @@ | |
| 115 | # A full merge of the branch brings in both of its check-ins, and the |
| 116 | # check-in that follows has two parents. |
| 117 | # |
| 118 | fossil merge mh-feature |
| 119 | fossil commit -m "mh-merge" --user-override frank |
| 120 | set merge [mergehist_hash mh-merge] |
| 121 | |
| 122 | test_eq merge-history-merge-content [read_file a.txt] \ |
| 123 | "1\n2\n3\n4-feature\n5\n6-feature\n" |
| 124 | test_eq merge-history-merge-g [read_file g.txt] "g\n" |
| 125 | test_eq merge-history-merge-cards [mergehist_cards $merge] \ |
| 126 |
| --- test/merge-history.test | |
| +++ test/merge-history.test | |
| @@ -23,20 +23,10 @@ | |
| 23 | |
| 24 | set path [file dirname [info script]] |
| 25 | |
| 26 | require_no_open_checkout |
| 27 | |
| 28 | # Returns the P-card and Q-cards of the manifest of CHECKIN as a list of |
| 29 | # lines. |
| 30 | # |
| 31 | proc mergehist_cards {checkin} { |
| 32 | fossil artifact $checkin |
| @@ -56,28 +46,24 @@ | |
| 46 | return $lines |
| 47 | } |
| 48 | |
| 49 | test_setup |
| 50 | |
| 51 | commit_file a.txt "1\n2\n3\n4\n5\n" "mh-c1" --user-override alice |
| 52 | set c1 [checkin_hash mh-c1] |
| 53 | |
| 54 | write_file a.txt "1\n2-trunk\n3\n4\n5\n" |
| 55 | fossil commit -m "mh-c2" --user-override bob |
| 56 | set c2 [checkin_hash mh-c2] |
| 57 | |
| 58 | fossil update $c1 |
| 59 | write_file a.txt "1\n2\n3\n4-feature\n5\n" |
| 60 | fossil commit -m "mh-f1" --branch mh-feature --user-override carol |
| 61 | set f1 [checkin_hash mh-f1] |
| 62 | write_file a.txt "1\n2\n3\n4-feature\n5\n6-feature\n" |
| 63 | commit_file g.txt "g\n" "mh-f2" --user-override carol |
| 64 | set f2 [checkin_hash mh-f2] |
| 65 | |
| 66 | ############################################################################### |
| 67 | # |
| 68 | # "fossil merge --cherrypick" applies the changes of one check-in: the |
| 69 | # edit of f1 and not the line and file that f2 adds. The check-in that |
| @@ -84,11 +70,11 @@ | |
| 70 | # follows has one parent and a Q-card "+F1". |
| 71 | # |
| 72 | fossil update trunk |
| 73 | fossil merge --cherrypick $f1 |
| 74 | fossil commit -m "mh-pick" --user-override dave |
| 75 | set pick [checkin_hash mh-pick] |
| 76 | |
| 77 | test_eq merge-history-cherrypick-content [read_file a.txt] \ |
| 78 | "1\n2-trunk\n3\n4-feature\n5\n" |
| 79 | test_eq merge-history-cherrypick-no-g [file exists g.txt] 0 |
| 80 | test_eq merge-history-cherrypick-cards [mergehist_cards $pick] \ |
| @@ -101,11 +87,11 @@ | |
| 87 | # Q-card "-C2". A backout of the parent itself is recorded without a |
| 88 | # Q-card, so these tests back out an earlier check-in. |
| 89 | # |
| 90 | fossil merge --backout $c2 |
| 91 | fossil commit -m "mh-backout" --user-override erin |
| 92 | set backout [checkin_hash mh-backout] |
| 93 | |
| 94 | test_eq merge-history-backout-content [read_file a.txt] \ |
| 95 | "1\n2\n3\n4-feature\n5\n" |
| 96 | test_eq merge-history-backout-cards [mergehist_cards $backout] \ |
| 97 | [list "P $pick" "Q -$c2"] |
| @@ -115,11 +101,11 @@ | |
| 101 | # A full merge of the branch brings in both of its check-ins, and the |
| 102 | # check-in that follows has two parents. |
| 103 | # |
| 104 | fossil merge mh-feature |
| 105 | fossil commit -m "mh-merge" --user-override frank |
| 106 | set merge [checkin_hash mh-merge] |
| 107 | |
| 108 | test_eq merge-history-merge-content [read_file a.txt] \ |
| 109 | "1\n2\n3\n4-feature\n5\n6-feature\n" |
| 110 | test_eq merge-history-merge-g [read_file g.txt] "g\n" |
| 111 | test_eq merge-history-merge-cards [mergehist_cards $merge] \ |
| 112 |
+1
-1
| --- test/merge5.test | ||
| +++ test/merge5.test | ||
| @@ -44,11 +44,11 @@ | ||
| 44 | 44 | |
| 45 | 45 | require_no_open_checkout; test_setup "" |
| 46 | 46 | |
| 47 | 47 | # Construct a test repository |
| 48 | 48 | # |
| 49 | -exec $::fossilexe sqlite3 --no-repository m5.fossil <$testdir/${testfile}_repo.sql | |
| 49 | +exec $::fossilexe sqlite3 --no-repository m5.fossil <$testfiledir/${testfile}_repo.sql | |
| 50 | 50 | fossil rebuild m5.fossil |
| 51 | 51 | fossil open m5.fossil |
| 52 | 52 | fossil user default drh --user drh |
| 53 | 53 | fossil update baseline |
| 54 | 54 | checkout-test 10 { |
| 55 | 55 |
| --- test/merge5.test | |
| +++ test/merge5.test | |
| @@ -44,11 +44,11 @@ | |
| 44 | |
| 45 | require_no_open_checkout; test_setup "" |
| 46 | |
| 47 | # Construct a test repository |
| 48 | # |
| 49 | exec $::fossilexe sqlite3 --no-repository m5.fossil <$testdir/${testfile}_repo.sql |
| 50 | fossil rebuild m5.fossil |
| 51 | fossil open m5.fossil |
| 52 | fossil user default drh --user drh |
| 53 | fossil update baseline |
| 54 | checkout-test 10 { |
| 55 |
| --- test/merge5.test | |
| +++ test/merge5.test | |
| @@ -44,11 +44,11 @@ | |
| 44 | |
| 45 | require_no_open_checkout; test_setup "" |
| 46 | |
| 47 | # Construct a test repository |
| 48 | # |
| 49 | exec $::fossilexe sqlite3 --no-repository m5.fossil <$testfiledir/${testfile}_repo.sql |
| 50 | fossil rebuild m5.fossil |
| 51 | fossil open m5.fossil |
| 52 | fossil user default drh --user drh |
| 53 | fossil update baseline |
| 54 | checkout-test 10 { |
| 55 |
+2
-6
| --- test/merge6.test | ||
| +++ test/merge6.test | ||
| @@ -25,21 +25,17 @@ | ||
| 25 | 25 | test_setup |
| 26 | 26 | fossil ls |
| 27 | 27 | |
| 28 | 28 | test merge_multi-0 {[normalize_result] eq {}} |
| 29 | 29 | |
| 30 | -write_file f1 "f1 line" | |
| 31 | -fossil add f1 | |
| 32 | -fossil commit -m "base file" | |
| 30 | +commit_file f1 "f1 line" "base file" | |
| 33 | 31 | fossil ls |
| 34 | 32 | |
| 35 | 33 | test merge_multi-1 {[normalize_result] eq {f1}} |
| 36 | 34 | |
| 37 | 35 | fossil update trunk |
| 38 | -write_file f2 "f2 line" | |
| 39 | -fossil add f2 | |
| 40 | -fossil commit -m "branch for file f2" -b branch_for_f2 | |
| 36 | +commit_file f2 "f2 line" "branch for file f2" -b branch_for_f2 | |
| 41 | 37 | fossil ls |
| 42 | 38 | |
| 43 | 39 | test merge_multi-2 {[normalize_result] eq {f1 |
| 44 | 40 | f2}} |
| 45 | 41 | |
| 46 | 42 |
| --- test/merge6.test | |
| +++ test/merge6.test | |
| @@ -25,21 +25,17 @@ | |
| 25 | test_setup |
| 26 | fossil ls |
| 27 | |
| 28 | test merge_multi-0 {[normalize_result] eq {}} |
| 29 | |
| 30 | write_file f1 "f1 line" |
| 31 | fossil add f1 |
| 32 | fossil commit -m "base file" |
| 33 | fossil ls |
| 34 | |
| 35 | test merge_multi-1 {[normalize_result] eq {f1}} |
| 36 | |
| 37 | fossil update trunk |
| 38 | write_file f2 "f2 line" |
| 39 | fossil add f2 |
| 40 | fossil commit -m "branch for file f2" -b branch_for_f2 |
| 41 | fossil ls |
| 42 | |
| 43 | test merge_multi-2 {[normalize_result] eq {f1 |
| 44 | f2}} |
| 45 | |
| 46 |
| --- test/merge6.test | |
| +++ test/merge6.test | |
| @@ -25,21 +25,17 @@ | |
| 25 | test_setup |
| 26 | fossil ls |
| 27 | |
| 28 | test merge_multi-0 {[normalize_result] eq {}} |
| 29 | |
| 30 | commit_file f1 "f1 line" "base file" |
| 31 | fossil ls |
| 32 | |
| 33 | test merge_multi-1 {[normalize_result] eq {f1}} |
| 34 | |
| 35 | fossil update trunk |
| 36 | commit_file f2 "f2 line" "branch for file f2" -b branch_for_f2 |
| 37 | fossil ls |
| 38 | |
| 39 | test merge_multi-2 {[normalize_result] eq {f1 |
| 40 | f2}} |
| 41 | |
| 42 |
+16
-48
| --- test/merge_renames.test | ||
| +++ test/merge_renames.test | ||
| @@ -15,13 +15,11 @@ | ||
| 15 | 15 | # Reported: Ticket [554f44ee74e3d] # |
| 16 | 16 | ###################################### |
| 17 | 17 | |
| 18 | 18 | test_setup |
| 19 | 19 | |
| 20 | -write_file f1 "line" | |
| 21 | -fossil add f1 | |
| 22 | -fossil commit -m "c1" | |
| 20 | +commit_file f1 "line" "c1" | |
| 23 | 21 | fossil tag add pivot current |
| 24 | 22 | |
| 25 | 23 | write_file f1 "line2" |
| 26 | 24 | fossil commit -m "c2" |
| 27 | 25 | |
| @@ -57,18 +55,14 @@ | ||
| 57 | 55 | # Reported: Ticket [74413366fe5067] # |
| 58 | 56 | ###################################### |
| 59 | 57 | |
| 60 | 58 | test_setup |
| 61 | 59 | |
| 62 | -write_file f1 "line" | |
| 63 | -fossil add f1 | |
| 64 | -fossil commit -m "base file" | |
| 60 | +commit_file f1 "line" "base file" | |
| 65 | 61 | fossil tag add pivot current |
| 66 | 62 | |
| 67 | -write_file f2 "line2" | |
| 68 | -fossil add f2 | |
| 69 | -fossil commit -m "newfile" | |
| 63 | +commit_file f2 "line2" "newfile" | |
| 70 | 64 | |
| 71 | 65 | fossil mv --hard f2 f2new |
| 72 | 66 | fossil commit -m "rename" |
| 73 | 67 | |
| 74 | 68 | fossil update pivot |
| @@ -88,18 +82,14 @@ | ||
| 88 | 82 | # Reported: Ticket [30b28cf351] # |
| 89 | 83 | ###################################### |
| 90 | 84 | |
| 91 | 85 | test_setup |
| 92 | 86 | |
| 93 | -write_file f1 "line" | |
| 94 | -fossil add f1 | |
| 95 | -fossil commit -m "base file" | |
| 87 | +commit_file f1 "line" "base file" | |
| 96 | 88 | fossil tag add pivot current |
| 97 | 89 | |
| 98 | -write_file f2 "line2" | |
| 99 | -fossil add f2 | |
| 100 | -fossil commit -m "newfile" | |
| 90 | +commit_file f2 "line2" "newfile" | |
| 101 | 91 | |
| 102 | 92 | fossil mv --hard f2 f2new |
| 103 | 93 | fossil commit -m "rename" |
| 104 | 94 | |
| 105 | 95 | fossil update pivot |
| @@ -119,13 +109,11 @@ | ||
| 119 | 109 | # Reported: Ticket [67176c3aa4] # |
| 120 | 110 | ###################################### |
| 121 | 111 | |
| 122 | 112 | test_setup |
| 123 | 113 | |
| 124 | -write_file f1 "f1" | |
| 125 | -fossil add f1 | |
| 126 | -fossil commit -m "add f1" | |
| 114 | +commit_file f1 "f1" "add f1" | |
| 127 | 115 | |
| 128 | 116 | write_file f1 "f1.1" |
| 129 | 117 | fossil commit --branch b -m "change f1" |
| 130 | 118 | |
| 131 | 119 | fossil update trunk |
| @@ -141,23 +129,17 @@ | ||
| 141 | 129 | # Handle Rename/Add via Merge # |
| 142 | 130 | ###################################### |
| 143 | 131 | |
| 144 | 132 | test_setup |
| 145 | 133 | |
| 146 | -write_file f1 "old f1 line" | |
| 147 | -fossil add f1 | |
| 148 | -fossil commit -m "base file" | |
| 134 | +commit_file f1 "old f1 line" "base file" | |
| 149 | 135 | |
| 150 | -write_file f3 "f3 line" | |
| 151 | -fossil add f3 | |
| 152 | -fossil commit -m "branch file" -b branch_for_f3 | |
| 136 | +commit_file f3 "f3 line" "branch file" -b branch_for_f3 | |
| 153 | 137 | |
| 154 | 138 | fossil update trunk |
| 155 | 139 | fossil mv --hard f1 f2 |
| 156 | -write_file f1 "new f1 line" | |
| 157 | -fossil add f1 | |
| 158 | -fossil commit -m "rename and add file with old name" | |
| 140 | +commit_file f1 "new f1 line" "rename and add file with old name" | |
| 159 | 141 | |
| 160 | 142 | fossil update branch_for_f3 |
| 161 | 143 | fossil merge trunk |
| 162 | 144 | test_status_list merge_renames-5-1 $RESULT { |
| 163 | 145 | RENAME f1 -> f2 |
| @@ -177,13 +159,11 @@ | ||
| 177 | 159 | # Merging a branch multiple times # |
| 178 | 160 | ##################################### |
| 179 | 161 | |
| 180 | 162 | test_setup |
| 181 | 163 | |
| 182 | -write_file f1 "f1" | |
| 183 | -fossil add f1 | |
| 184 | -fossil commit -m "add f1" | |
| 164 | +commit_file f1 "f1" "add f1" | |
| 185 | 165 | |
| 186 | 166 | fossil mv --hard f1 f2 |
| 187 | 167 | fossil commit -b b -m "f1 -> f2" |
| 188 | 168 | |
| 189 | 169 | fossil update trunk |
| @@ -227,13 +207,11 @@ | ||
| 227 | 207 | # in the merged branch and adding a new file with the original name # |
| 228 | 208 | ######################################################################## |
| 229 | 209 | |
| 230 | 210 | test_setup |
| 231 | 211 | |
| 232 | -write_file f1 "f1" | |
| 233 | -fossil add f1 | |
| 234 | -fossil commit -m "add f1" | |
| 212 | +commit_file f1 "f1" "add f1" | |
| 235 | 213 | |
| 236 | 214 | fossil mv --hard f1 f2 |
| 237 | 215 | write_file f2 "f2" |
| 238 | 216 | fossil commit -b b -m "f1 -> f2, edit f2" |
| 239 | 217 | |
| @@ -294,13 +272,11 @@ | ||
| 294 | 272 | fossil commit -b b -m "delete f2" |
| 295 | 273 | |
| 296 | 274 | fossil mv --hard f1 f2 |
| 297 | 275 | fossil commit -m "f1 -> f2" |
| 298 | 276 | |
| 299 | -write_file f1 "f1.1" | |
| 300 | -fossil add f1 | |
| 301 | -fossil commit -m "add new f1" | |
| 277 | +commit_file f1 "f1.1" "add new f1" | |
| 302 | 278 | |
| 303 | 279 | fossil update trunk |
| 304 | 280 | fossil merge b |
| 305 | 281 | set expectedMerge { |
| 306 | 282 | DELETE f2 |
| @@ -392,13 +368,11 @@ | ||
| 392 | 368 | # Specifying a baseline # |
| 393 | 369 | ############################################ |
| 394 | 370 | |
| 395 | 371 | test_setup |
| 396 | 372 | |
| 397 | -write_file f1 "line" | |
| 398 | -fossil add f1 | |
| 399 | -fossil commit -m "add f1" | |
| 373 | +commit_file f1 "line" "add f1" | |
| 400 | 374 | |
| 401 | 375 | write_file f1 "line\nline2" |
| 402 | 376 | fossil commit -b b -m "edit f2" --tag p1 |
| 403 | 377 | |
| 404 | 378 | fossil mv --hard f1 f2 |
| @@ -428,13 +402,11 @@ | ||
| 428 | 402 | # of either the checked-out commit or the commit being merged # |
| 429 | 403 | ################################################################# |
| 430 | 404 | |
| 431 | 405 | test_setup |
| 432 | 406 | |
| 433 | -write_file f1 "f1\n" | |
| 434 | -fossil add f1 | |
| 435 | -fossil commit -m "add f1" --tag n | |
| 407 | +commit_file f1 "f1\n" "add f1" --tag n | |
| 436 | 408 | |
| 437 | 409 | fossil mv --hard f1 f1n |
| 438 | 410 | fossil commit -m "f1 -> f1n" |
| 439 | 411 | |
| 440 | 412 | fossil mv --hard f1n f1v |
| @@ -475,17 +447,13 @@ | ||
| 475 | 447 | # Merge in add+rename that happened on a branch, then merged # |
| 476 | 448 | # back to branch, and again to trunk, then merge in branch. # |
| 477 | 449 | ################################################################# |
| 478 | 450 | |
| 479 | 451 | set repoDir [test_setup] |
| 480 | -write_file f1 "line1" | |
| 481 | -fossil add f1 | |
| 482 | -fossil commit -m "add f1" --tag c1 | |
| 452 | +commit_file f1 "line1" "add f1" --tag c1 | |
| 483 | 453 | |
| 484 | -write_file f2 "line1" | |
| 485 | -fossil add f2 | |
| 486 | -fossil commit -m "add f2 on branch" -b b --tag c2 | |
| 454 | +commit_file f2 "line1" "add f2 on branch" -b b --tag c2 | |
| 487 | 455 | fossil update trunk |
| 488 | 456 | test_status_list merge_renames_13-1 $RESULT {REMOVE f2} |
| 489 | 457 | write_file f1 "line1\nline2\n" |
| 490 | 458 | fossil commit -m "edit f1 on trunk" --tag c3 |
| 491 | 459 | |
| 492 | 460 |
| --- test/merge_renames.test | |
| +++ test/merge_renames.test | |
| @@ -15,13 +15,11 @@ | |
| 15 | # Reported: Ticket [554f44ee74e3d] # |
| 16 | ###################################### |
| 17 | |
| 18 | test_setup |
| 19 | |
| 20 | write_file f1 "line" |
| 21 | fossil add f1 |
| 22 | fossil commit -m "c1" |
| 23 | fossil tag add pivot current |
| 24 | |
| 25 | write_file f1 "line2" |
| 26 | fossil commit -m "c2" |
| 27 | |
| @@ -57,18 +55,14 @@ | |
| 57 | # Reported: Ticket [74413366fe5067] # |
| 58 | ###################################### |
| 59 | |
| 60 | test_setup |
| 61 | |
| 62 | write_file f1 "line" |
| 63 | fossil add f1 |
| 64 | fossil commit -m "base file" |
| 65 | fossil tag add pivot current |
| 66 | |
| 67 | write_file f2 "line2" |
| 68 | fossil add f2 |
| 69 | fossil commit -m "newfile" |
| 70 | |
| 71 | fossil mv --hard f2 f2new |
| 72 | fossil commit -m "rename" |
| 73 | |
| 74 | fossil update pivot |
| @@ -88,18 +82,14 @@ | |
| 88 | # Reported: Ticket [30b28cf351] # |
| 89 | ###################################### |
| 90 | |
| 91 | test_setup |
| 92 | |
| 93 | write_file f1 "line" |
| 94 | fossil add f1 |
| 95 | fossil commit -m "base file" |
| 96 | fossil tag add pivot current |
| 97 | |
| 98 | write_file f2 "line2" |
| 99 | fossil add f2 |
| 100 | fossil commit -m "newfile" |
| 101 | |
| 102 | fossil mv --hard f2 f2new |
| 103 | fossil commit -m "rename" |
| 104 | |
| 105 | fossil update pivot |
| @@ -119,13 +109,11 @@ | |
| 119 | # Reported: Ticket [67176c3aa4] # |
| 120 | ###################################### |
| 121 | |
| 122 | test_setup |
| 123 | |
| 124 | write_file f1 "f1" |
| 125 | fossil add f1 |
| 126 | fossil commit -m "add f1" |
| 127 | |
| 128 | write_file f1 "f1.1" |
| 129 | fossil commit --branch b -m "change f1" |
| 130 | |
| 131 | fossil update trunk |
| @@ -141,23 +129,17 @@ | |
| 141 | # Handle Rename/Add via Merge # |
| 142 | ###################################### |
| 143 | |
| 144 | test_setup |
| 145 | |
| 146 | write_file f1 "old f1 line" |
| 147 | fossil add f1 |
| 148 | fossil commit -m "base file" |
| 149 | |
| 150 | write_file f3 "f3 line" |
| 151 | fossil add f3 |
| 152 | fossil commit -m "branch file" -b branch_for_f3 |
| 153 | |
| 154 | fossil update trunk |
| 155 | fossil mv --hard f1 f2 |
| 156 | write_file f1 "new f1 line" |
| 157 | fossil add f1 |
| 158 | fossil commit -m "rename and add file with old name" |
| 159 | |
| 160 | fossil update branch_for_f3 |
| 161 | fossil merge trunk |
| 162 | test_status_list merge_renames-5-1 $RESULT { |
| 163 | RENAME f1 -> f2 |
| @@ -177,13 +159,11 @@ | |
| 177 | # Merging a branch multiple times # |
| 178 | ##################################### |
| 179 | |
| 180 | test_setup |
| 181 | |
| 182 | write_file f1 "f1" |
| 183 | fossil add f1 |
| 184 | fossil commit -m "add f1" |
| 185 | |
| 186 | fossil mv --hard f1 f2 |
| 187 | fossil commit -b b -m "f1 -> f2" |
| 188 | |
| 189 | fossil update trunk |
| @@ -227,13 +207,11 @@ | |
| 227 | # in the merged branch and adding a new file with the original name # |
| 228 | ######################################################################## |
| 229 | |
| 230 | test_setup |
| 231 | |
| 232 | write_file f1 "f1" |
| 233 | fossil add f1 |
| 234 | fossil commit -m "add f1" |
| 235 | |
| 236 | fossil mv --hard f1 f2 |
| 237 | write_file f2 "f2" |
| 238 | fossil commit -b b -m "f1 -> f2, edit f2" |
| 239 | |
| @@ -294,13 +272,11 @@ | |
| 294 | fossil commit -b b -m "delete f2" |
| 295 | |
| 296 | fossil mv --hard f1 f2 |
| 297 | fossil commit -m "f1 -> f2" |
| 298 | |
| 299 | write_file f1 "f1.1" |
| 300 | fossil add f1 |
| 301 | fossil commit -m "add new f1" |
| 302 | |
| 303 | fossil update trunk |
| 304 | fossil merge b |
| 305 | set expectedMerge { |
| 306 | DELETE f2 |
| @@ -392,13 +368,11 @@ | |
| 392 | # Specifying a baseline # |
| 393 | ############################################ |
| 394 | |
| 395 | test_setup |
| 396 | |
| 397 | write_file f1 "line" |
| 398 | fossil add f1 |
| 399 | fossil commit -m "add f1" |
| 400 | |
| 401 | write_file f1 "line\nline2" |
| 402 | fossil commit -b b -m "edit f2" --tag p1 |
| 403 | |
| 404 | fossil mv --hard f1 f2 |
| @@ -428,13 +402,11 @@ | |
| 428 | # of either the checked-out commit or the commit being merged # |
| 429 | ################################################################# |
| 430 | |
| 431 | test_setup |
| 432 | |
| 433 | write_file f1 "f1\n" |
| 434 | fossil add f1 |
| 435 | fossil commit -m "add f1" --tag n |
| 436 | |
| 437 | fossil mv --hard f1 f1n |
| 438 | fossil commit -m "f1 -> f1n" |
| 439 | |
| 440 | fossil mv --hard f1n f1v |
| @@ -475,17 +447,13 @@ | |
| 475 | # Merge in add+rename that happened on a branch, then merged # |
| 476 | # back to branch, and again to trunk, then merge in branch. # |
| 477 | ################################################################# |
| 478 | |
| 479 | set repoDir [test_setup] |
| 480 | write_file f1 "line1" |
| 481 | fossil add f1 |
| 482 | fossil commit -m "add f1" --tag c1 |
| 483 | |
| 484 | write_file f2 "line1" |
| 485 | fossil add f2 |
| 486 | fossil commit -m "add f2 on branch" -b b --tag c2 |
| 487 | fossil update trunk |
| 488 | test_status_list merge_renames_13-1 $RESULT {REMOVE f2} |
| 489 | write_file f1 "line1\nline2\n" |
| 490 | fossil commit -m "edit f1 on trunk" --tag c3 |
| 491 | |
| 492 |
| --- test/merge_renames.test | |
| +++ test/merge_renames.test | |
| @@ -15,13 +15,11 @@ | |
| 15 | # Reported: Ticket [554f44ee74e3d] # |
| 16 | ###################################### |
| 17 | |
| 18 | test_setup |
| 19 | |
| 20 | commit_file f1 "line" "c1" |
| 21 | fossil tag add pivot current |
| 22 | |
| 23 | write_file f1 "line2" |
| 24 | fossil commit -m "c2" |
| 25 | |
| @@ -57,18 +55,14 @@ | |
| 55 | # Reported: Ticket [74413366fe5067] # |
| 56 | ###################################### |
| 57 | |
| 58 | test_setup |
| 59 | |
| 60 | commit_file f1 "line" "base file" |
| 61 | fossil tag add pivot current |
| 62 | |
| 63 | commit_file f2 "line2" "newfile" |
| 64 | |
| 65 | fossil mv --hard f2 f2new |
| 66 | fossil commit -m "rename" |
| 67 | |
| 68 | fossil update pivot |
| @@ -88,18 +82,14 @@ | |
| 82 | # Reported: Ticket [30b28cf351] # |
| 83 | ###################################### |
| 84 | |
| 85 | test_setup |
| 86 | |
| 87 | commit_file f1 "line" "base file" |
| 88 | fossil tag add pivot current |
| 89 | |
| 90 | commit_file f2 "line2" "newfile" |
| 91 | |
| 92 | fossil mv --hard f2 f2new |
| 93 | fossil commit -m "rename" |
| 94 | |
| 95 | fossil update pivot |
| @@ -119,13 +109,11 @@ | |
| 109 | # Reported: Ticket [67176c3aa4] # |
| 110 | ###################################### |
| 111 | |
| 112 | test_setup |
| 113 | |
| 114 | commit_file f1 "f1" "add f1" |
| 115 | |
| 116 | write_file f1 "f1.1" |
| 117 | fossil commit --branch b -m "change f1" |
| 118 | |
| 119 | fossil update trunk |
| @@ -141,23 +129,17 @@ | |
| 129 | # Handle Rename/Add via Merge # |
| 130 | ###################################### |
| 131 | |
| 132 | test_setup |
| 133 | |
| 134 | commit_file f1 "old f1 line" "base file" |
| 135 | |
| 136 | commit_file f3 "f3 line" "branch file" -b branch_for_f3 |
| 137 | |
| 138 | fossil update trunk |
| 139 | fossil mv --hard f1 f2 |
| 140 | commit_file f1 "new f1 line" "rename and add file with old name" |
| 141 | |
| 142 | fossil update branch_for_f3 |
| 143 | fossil merge trunk |
| 144 | test_status_list merge_renames-5-1 $RESULT { |
| 145 | RENAME f1 -> f2 |
| @@ -177,13 +159,11 @@ | |
| 159 | # Merging a branch multiple times # |
| 160 | ##################################### |
| 161 | |
| 162 | test_setup |
| 163 | |
| 164 | commit_file f1 "f1" "add f1" |
| 165 | |
| 166 | fossil mv --hard f1 f2 |
| 167 | fossil commit -b b -m "f1 -> f2" |
| 168 | |
| 169 | fossil update trunk |
| @@ -227,13 +207,11 @@ | |
| 207 | # in the merged branch and adding a new file with the original name # |
| 208 | ######################################################################## |
| 209 | |
| 210 | test_setup |
| 211 | |
| 212 | commit_file f1 "f1" "add f1" |
| 213 | |
| 214 | fossil mv --hard f1 f2 |
| 215 | write_file f2 "f2" |
| 216 | fossil commit -b b -m "f1 -> f2, edit f2" |
| 217 | |
| @@ -294,13 +272,11 @@ | |
| 272 | fossil commit -b b -m "delete f2" |
| 273 | |
| 274 | fossil mv --hard f1 f2 |
| 275 | fossil commit -m "f1 -> f2" |
| 276 | |
| 277 | commit_file f1 "f1.1" "add new f1" |
| 278 | |
| 279 | fossil update trunk |
| 280 | fossil merge b |
| 281 | set expectedMerge { |
| 282 | DELETE f2 |
| @@ -392,13 +368,11 @@ | |
| 368 | # Specifying a baseline # |
| 369 | ############################################ |
| 370 | |
| 371 | test_setup |
| 372 | |
| 373 | commit_file f1 "line" "add f1" |
| 374 | |
| 375 | write_file f1 "line\nline2" |
| 376 | fossil commit -b b -m "edit f2" --tag p1 |
| 377 | |
| 378 | fossil mv --hard f1 f2 |
| @@ -428,13 +402,11 @@ | |
| 402 | # of either the checked-out commit or the commit being merged # |
| 403 | ################################################################# |
| 404 | |
| 405 | test_setup |
| 406 | |
| 407 | commit_file f1 "f1\n" "add f1" --tag n |
| 408 | |
| 409 | fossil mv --hard f1 f1n |
| 410 | fossil commit -m "f1 -> f1n" |
| 411 | |
| 412 | fossil mv --hard f1n f1v |
| @@ -475,17 +447,13 @@ | |
| 447 | # Merge in add+rename that happened on a branch, then merged # |
| 448 | # back to branch, and again to trunk, then merge in branch. # |
| 449 | ################################################################# |
| 450 | |
| 451 | set repoDir [test_setup] |
| 452 | commit_file f1 "line1" "add f1" --tag c1 |
| 453 | |
| 454 | commit_file f2 "line1" "add f2 on branch" -b b --tag c2 |
| 455 | fossil update trunk |
| 456 | test_status_list merge_renames_13-1 $RESULT {REMOVE f2} |
| 457 | write_file f1 "line1\nline2\n" |
| 458 | fossil commit -m "edit f1 on trunk" --tag c3 |
| 459 | |
| 460 |
+2
-11
| --- test/merge_renames_2.test | ||
| +++ test/merge_renames_2.test | ||
| @@ -1,31 +1,22 @@ | ||
| 1 | 1 | # |
| 2 | 2 | # Tests for merging with renames |
| 3 | 3 | # |
| 4 | 4 | # |
| 5 | 5 | |
| 6 | -proc commit_id {version} { | |
| 7 | - regexp -line {^artifact:\s+(\S+)} [fossil whatis $version] - id | |
| 8 | - return $id | |
| 9 | -} | |
| 10 | - | |
| 11 | 6 | require_no_open_checkout |
| 12 | 7 | |
| 13 | 8 | ################################################################# |
| 14 | 9 | # Test 1 # |
| 15 | 10 | # https://fossil-scm.org/forum/forumpost/549700437b # |
| 16 | 11 | ################################################################# |
| 17 | 12 | |
| 18 | 13 | test_setup |
| 19 | 14 | |
| 20 | -write_file file1 "file1\n" | |
| 21 | -fossil add file1 | |
| 22 | -fossil commit -m "added file1" | |
| 15 | +commit_file file1 "file1\n" "added file1" | |
| 23 | 16 | |
| 24 | -write_file file2 "file2\n" | |
| 25 | -fossil add file2 | |
| 26 | -fossil commit -m "added file2" --branch added | |
| 17 | +commit_file file2 "file2\n" "added file2" --branch added | |
| 27 | 18 | |
| 28 | 19 | write_file file2 "edit file2 on added\n" |
| 29 | 20 | fossil commit -m "edited file2" |
| 30 | 21 | |
| 31 | 22 | fossil mv --hard file2 file2.renamed |
| 32 | 23 |
| --- test/merge_renames_2.test | |
| +++ test/merge_renames_2.test | |
| @@ -1,31 +1,22 @@ | |
| 1 | # |
| 2 | # Tests for merging with renames |
| 3 | # |
| 4 | # |
| 5 | |
| 6 | proc commit_id {version} { |
| 7 | regexp -line {^artifact:\s+(\S+)} [fossil whatis $version] - id |
| 8 | return $id |
| 9 | } |
| 10 | |
| 11 | require_no_open_checkout |
| 12 | |
| 13 | ################################################################# |
| 14 | # Test 1 # |
| 15 | # https://fossil-scm.org/forum/forumpost/549700437b # |
| 16 | ################################################################# |
| 17 | |
| 18 | test_setup |
| 19 | |
| 20 | write_file file1 "file1\n" |
| 21 | fossil add file1 |
| 22 | fossil commit -m "added file1" |
| 23 | |
| 24 | write_file file2 "file2\n" |
| 25 | fossil add file2 |
| 26 | fossil commit -m "added file2" --branch added |
| 27 | |
| 28 | write_file file2 "edit file2 on added\n" |
| 29 | fossil commit -m "edited file2" |
| 30 | |
| 31 | fossil mv --hard file2 file2.renamed |
| 32 |
| --- test/merge_renames_2.test | |
| +++ test/merge_renames_2.test | |
| @@ -1,31 +1,22 @@ | |
| 1 | # |
| 2 | # Tests for merging with renames |
| 3 | # |
| 4 | # |
| 5 | |
| 6 | require_no_open_checkout |
| 7 | |
| 8 | ################################################################# |
| 9 | # Test 1 # |
| 10 | # https://fossil-scm.org/forum/forumpost/549700437b # |
| 11 | ################################################################# |
| 12 | |
| 13 | test_setup |
| 14 | |
| 15 | commit_file file1 "file1\n" "added file1" |
| 16 | |
| 17 | commit_file file2 "file2\n" "added file2" --branch added |
| 18 | |
| 19 | write_file file2 "edit file2 on added\n" |
| 20 | fossil commit -m "edited file2" |
| 21 | |
| 22 | fossil mv --hard file2 file2.renamed |
| 23 |
+3
-9
| --- test/merge_warn.test | ||
| +++ test/merge_warn.test | ||
| @@ -18,28 +18,22 @@ | ||
| 18 | 18 | # Testing "merge" command warnings |
| 19 | 19 | # |
| 20 | 20 | |
| 21 | 21 | test_setup |
| 22 | 22 | |
| 23 | -write_file f1 "f1" | |
| 24 | -fossil add f1 | |
| 25 | -fossil commit -m "add f1" --tag pivot | |
| 23 | +commit_file f1 "f1" "add f1" --tag pivot | |
| 26 | 24 | |
| 27 | -write_file f2 "f2" | |
| 28 | -fossil add f2 | |
| 29 | -fossil commit -m "add f2" | |
| 25 | +commit_file f2 "f2" "add f2" | |
| 30 | 26 | |
| 31 | 27 | fossil update pivot |
| 32 | 28 | fossil rm --hard f1 |
| 33 | 29 | write_file f2 "f2.1" |
| 34 | 30 | write_file f3 "f3" |
| 35 | 31 | fossil add f2 f3 |
| 36 | 32 | fossil commit -b b -m "delete f1, add f2 and f3" --tag mrg |
| 37 | 33 | |
| 38 | -write_file f4 "f4" | |
| 39 | -fossil add f4 | |
| 40 | -fossil commit -m "add f4" | |
| 34 | +commit_file f4 "f4" "add f4" | |
| 41 | 35 | |
| 42 | 36 | fossil update trunk |
| 43 | 37 | write_file f1 "f1.1" |
| 44 | 38 | write_file f3 "f3.1" |
| 45 | 39 | fossil merge --integrate mrg -expectError |
| 46 | 40 |
| --- test/merge_warn.test | |
| +++ test/merge_warn.test | |
| @@ -18,28 +18,22 @@ | |
| 18 | # Testing "merge" command warnings |
| 19 | # |
| 20 | |
| 21 | test_setup |
| 22 | |
| 23 | write_file f1 "f1" |
| 24 | fossil add f1 |
| 25 | fossil commit -m "add f1" --tag pivot |
| 26 | |
| 27 | write_file f2 "f2" |
| 28 | fossil add f2 |
| 29 | fossil commit -m "add f2" |
| 30 | |
| 31 | fossil update pivot |
| 32 | fossil rm --hard f1 |
| 33 | write_file f2 "f2.1" |
| 34 | write_file f3 "f3" |
| 35 | fossil add f2 f3 |
| 36 | fossil commit -b b -m "delete f1, add f2 and f3" --tag mrg |
| 37 | |
| 38 | write_file f4 "f4" |
| 39 | fossil add f4 |
| 40 | fossil commit -m "add f4" |
| 41 | |
| 42 | fossil update trunk |
| 43 | write_file f1 "f1.1" |
| 44 | write_file f3 "f3.1" |
| 45 | fossil merge --integrate mrg -expectError |
| 46 |
| --- test/merge_warn.test | |
| +++ test/merge_warn.test | |
| @@ -18,28 +18,22 @@ | |
| 18 | # Testing "merge" command warnings |
| 19 | # |
| 20 | |
| 21 | test_setup |
| 22 | |
| 23 | commit_file f1 "f1" "add f1" --tag pivot |
| 24 | |
| 25 | commit_file f2 "f2" "add f2" |
| 26 | |
| 27 | fossil update pivot |
| 28 | fossil rm --hard f1 |
| 29 | write_file f2 "f2.1" |
| 30 | write_file f3 "f3" |
| 31 | fossil add f2 f3 |
| 32 | fossil commit -b b -m "delete f1, add f2 and f3" --tag mrg |
| 33 | |
| 34 | commit_file f4 "f4" "add f4" |
| 35 | |
| 36 | fossil update trunk |
| 37 | write_file f1 "f1.1" |
| 38 | write_file f3 "f3.1" |
| 39 | fossil merge --integrate mrg -expectError |
| 40 |
+2
-6
| --- test/revert.test | ||
| +++ test/revert.test | ||
| @@ -158,13 +158,11 @@ | ||
| 158 | 158 | |
| 159 | 159 | # Test reverting the combination of a renamed file and an added file that |
| 160 | 160 | # uses the renamed file's original filename. |
| 161 | 161 | # |
| 162 | 162 | test_setup |
| 163 | -write_file f1 "f1" | |
| 164 | -fossil add f1 | |
| 165 | -fossil commit -m "add f1" | |
| 163 | +commit_file f1 "f1" "add f1" | |
| 166 | 164 | |
| 167 | 165 | write_file f1n "f1n" |
| 168 | 166 | fossil mv f1 f1n |
| 169 | 167 | write_file f1 "f1b" |
| 170 | 168 | fossil add f1 |
| @@ -176,13 +174,11 @@ | ||
| 176 | 174 | |
| 177 | 175 | |
| 178 | 176 | # Test reverting a rename in the repo but not completed in the file |
| 179 | 177 | # system |
| 180 | 178 | test_setup |
| 181 | -write_file f1 "f1" | |
| 182 | -fossil add f1 | |
| 183 | -fossil commit -m "add f1" | |
| 179 | +commit_file f1 "f1" "add f1" | |
| 184 | 180 | fossil mv --soft f1 f1new |
| 185 | 181 | test 3-mv-1 {[file exists f1]} |
| 186 | 182 | test 3-mv-2 {![file exists f1new]} |
| 187 | 183 | revert-test 3-1 {} { |
| 188 | 184 | REVERT f1 |
| 189 | 185 |
| --- test/revert.test | |
| +++ test/revert.test | |
| @@ -158,13 +158,11 @@ | |
| 158 | |
| 159 | # Test reverting the combination of a renamed file and an added file that |
| 160 | # uses the renamed file's original filename. |
| 161 | # |
| 162 | test_setup |
| 163 | write_file f1 "f1" |
| 164 | fossil add f1 |
| 165 | fossil commit -m "add f1" |
| 166 | |
| 167 | write_file f1n "f1n" |
| 168 | fossil mv f1 f1n |
| 169 | write_file f1 "f1b" |
| 170 | fossil add f1 |
| @@ -176,13 +174,11 @@ | |
| 176 | |
| 177 | |
| 178 | # Test reverting a rename in the repo but not completed in the file |
| 179 | # system |
| 180 | test_setup |
| 181 | write_file f1 "f1" |
| 182 | fossil add f1 |
| 183 | fossil commit -m "add f1" |
| 184 | fossil mv --soft f1 f1new |
| 185 | test 3-mv-1 {[file exists f1]} |
| 186 | test 3-mv-2 {![file exists f1new]} |
| 187 | revert-test 3-1 {} { |
| 188 | REVERT f1 |
| 189 |
| --- test/revert.test | |
| +++ test/revert.test | |
| @@ -158,13 +158,11 @@ | |
| 158 | |
| 159 | # Test reverting the combination of a renamed file and an added file that |
| 160 | # uses the renamed file's original filename. |
| 161 | # |
| 162 | test_setup |
| 163 | commit_file f1 "f1" "add f1" |
| 164 | |
| 165 | write_file f1n "f1n" |
| 166 | fossil mv f1 f1n |
| 167 | write_file f1 "f1b" |
| 168 | fossil add f1 |
| @@ -176,13 +174,11 @@ | |
| 174 | |
| 175 | |
| 176 | # Test reverting a rename in the repo but not completed in the file |
| 177 | # system |
| 178 | test_setup |
| 179 | commit_file f1 "f1" "add f1" |
| 180 | fossil mv --soft f1 f1new |
| 181 | test 3-mv-1 {[file exists f1]} |
| 182 | test 3-mv-2 {![file exists f1new]} |
| 183 | revert-test 3-1 {} { |
| 184 | REVERT f1 |
| 185 |
+2
-6
| --- test/roundtrip.test | ||
| +++ test/roundtrip.test | ||
| @@ -161,13 +161,11 @@ | ||
| 161 | 161 | write_file noeol.txt "no newline" |
| 162 | 162 | fossil add a.txt b.txt sub noeol.txt |
| 163 | 163 | fossil commit -m "rt-c1" |
| 164 | 164 | |
| 165 | 165 | write_file a.txt "one\nTWO\nthree\n" |
| 166 | -write_file d.txt "d\n" | |
| 167 | -fossil add d.txt | |
| 168 | -fossil commit -m "rt-c2" | |
| 166 | +commit_file d.txt "d\n" "rt-c2" | |
| 169 | 167 | |
| 170 | 168 | fossil branch new rt-feature current |
| 171 | 169 | fossil update rt-feature |
| 172 | 170 | write_file a.txt "one\nTWO\nthree\nfour\n" |
| 173 | 171 | fossil commit -m "rt-f1" |
| @@ -228,13 +226,11 @@ | ||
| 228 | 226 | fossil update trunk |
| 229 | 227 | fossil branch new rt-bundled current |
| 230 | 228 | fossil update rt-bundled |
| 231 | 229 | write_file a.txt "bundled\n" |
| 232 | 230 | fossil commit -m "rt-b1" |
| 233 | -write_file e.txt "e\n" | |
| 234 | -fossil add e.txt | |
| 235 | -fossil commit -m "rt-b2" | |
| 231 | +commit_file e.txt "e\n" "rt-b2" | |
| 236 | 232 | fossil update trunk |
| 237 | 233 | |
| 238 | 234 | fossil bundle export rt.bundle --branch rt-bundled |
| 239 | 235 | fossil bundle import rt.bundle --publish -R clone.fossil |
| 240 | 236 | |
| 241 | 237 |
| --- test/roundtrip.test | |
| +++ test/roundtrip.test | |
| @@ -161,13 +161,11 @@ | |
| 161 | write_file noeol.txt "no newline" |
| 162 | fossil add a.txt b.txt sub noeol.txt |
| 163 | fossil commit -m "rt-c1" |
| 164 | |
| 165 | write_file a.txt "one\nTWO\nthree\n" |
| 166 | write_file d.txt "d\n" |
| 167 | fossil add d.txt |
| 168 | fossil commit -m "rt-c2" |
| 169 | |
| 170 | fossil branch new rt-feature current |
| 171 | fossil update rt-feature |
| 172 | write_file a.txt "one\nTWO\nthree\nfour\n" |
| 173 | fossil commit -m "rt-f1" |
| @@ -228,13 +226,11 @@ | |
| 228 | fossil update trunk |
| 229 | fossil branch new rt-bundled current |
| 230 | fossil update rt-bundled |
| 231 | write_file a.txt "bundled\n" |
| 232 | fossil commit -m "rt-b1" |
| 233 | write_file e.txt "e\n" |
| 234 | fossil add e.txt |
| 235 | fossil commit -m "rt-b2" |
| 236 | fossil update trunk |
| 237 | |
| 238 | fossil bundle export rt.bundle --branch rt-bundled |
| 239 | fossil bundle import rt.bundle --publish -R clone.fossil |
| 240 | |
| 241 |
| --- test/roundtrip.test | |
| +++ test/roundtrip.test | |
| @@ -161,13 +161,11 @@ | |
| 161 | write_file noeol.txt "no newline" |
| 162 | fossil add a.txt b.txt sub noeol.txt |
| 163 | fossil commit -m "rt-c1" |
| 164 | |
| 165 | write_file a.txt "one\nTWO\nthree\n" |
| 166 | commit_file d.txt "d\n" "rt-c2" |
| 167 | |
| 168 | fossil branch new rt-feature current |
| 169 | fossil update rt-feature |
| 170 | write_file a.txt "one\nTWO\nthree\nfour\n" |
| 171 | fossil commit -m "rt-f1" |
| @@ -228,13 +226,11 @@ | |
| 226 | fossil update trunk |
| 227 | fossil branch new rt-bundled current |
| 228 | fossil update rt-bundled |
| 229 | write_file a.txt "bundled\n" |
| 230 | fossil commit -m "rt-b1" |
| 231 | commit_file e.txt "e\n" "rt-b2" |
| 232 | fossil update trunk |
| 233 | |
| 234 | fossil bundle export rt.bundle --branch rt-bundled |
| 235 | fossil bundle import rt.bundle --publish -R clone.fossil |
| 236 | |
| 237 |
+2
-6
| --- test/set-manifest.test | ||
| +++ test/set-manifest.test | ||
| @@ -125,13 +125,11 @@ | ||
| 125 | 125 | # Add a tag and make sure it appears in manifest.tags |
| 126 | 126 | fossil tag add manifest-7-tag-1 tip |
| 127 | 127 | test "set-manifest-7-2" {[file_contains "manifest.tags" "^tag manifest-7-tag-1$"]} |
| 128 | 128 | |
| 129 | 129 | # Add a file and make sure tag has disappeared from manifest.tags |
| 130 | -write_file file1 "file1 contents" | |
| 131 | -fossil add file1 | |
| 132 | -fossil commit -m "Added file1." | |
| 130 | +commit_file file1 "file1 contents" "Added file1." | |
| 133 | 131 | test "set-manifest-7-3" {![file_contains "manifest.tags" "^tag manifest-7-tag-1$"]} |
| 134 | 132 | |
| 135 | 133 | # Add new tag and check that it is in manifest.tags |
| 136 | 134 | fossil tag add manifest-7-tag-2 tip |
| 137 | 135 | test "set-manifest-7-4" {[file_contains "manifest.tags" "^tag manifest-7-tag-2$"]} |
| @@ -139,12 +137,10 @@ | ||
| 139 | 137 | |
| 140 | 138 | ##### Tags manifest branch= updates |
| 141 | 139 | |
| 142 | 140 | # Add file, create new branch on commit and check that |
| 143 | 141 | # manifest.tags has been updated appropriately |
| 144 | -write_file file3 "file3 contents" | |
| 145 | -fossil add file3 | |
| 146 | -fossil commit -m "Added file3." --branch manifest-8-branch | |
| 142 | +commit_file file3 "file3 contents" "Added file3." --branch manifest-8-branch | |
| 147 | 143 | test "set-manifest-8" {[file_contains "manifest.tags" "^branch manifest-8-branch$"]} |
| 148 | 144 | |
| 149 | 145 | |
| 150 | 146 | test_cleanup |
| 151 | 147 |
| --- test/set-manifest.test | |
| +++ test/set-manifest.test | |
| @@ -125,13 +125,11 @@ | |
| 125 | # Add a tag and make sure it appears in manifest.tags |
| 126 | fossil tag add manifest-7-tag-1 tip |
| 127 | test "set-manifest-7-2" {[file_contains "manifest.tags" "^tag manifest-7-tag-1$"]} |
| 128 | |
| 129 | # Add a file and make sure tag has disappeared from manifest.tags |
| 130 | write_file file1 "file1 contents" |
| 131 | fossil add file1 |
| 132 | fossil commit -m "Added file1." |
| 133 | test "set-manifest-7-3" {![file_contains "manifest.tags" "^tag manifest-7-tag-1$"]} |
| 134 | |
| 135 | # Add new tag and check that it is in manifest.tags |
| 136 | fossil tag add manifest-7-tag-2 tip |
| 137 | test "set-manifest-7-4" {[file_contains "manifest.tags" "^tag manifest-7-tag-2$"]} |
| @@ -139,12 +137,10 @@ | |
| 139 | |
| 140 | ##### Tags manifest branch= updates |
| 141 | |
| 142 | # Add file, create new branch on commit and check that |
| 143 | # manifest.tags has been updated appropriately |
| 144 | write_file file3 "file3 contents" |
| 145 | fossil add file3 |
| 146 | fossil commit -m "Added file3." --branch manifest-8-branch |
| 147 | test "set-manifest-8" {[file_contains "manifest.tags" "^branch manifest-8-branch$"]} |
| 148 | |
| 149 | |
| 150 | test_cleanup |
| 151 |
| --- test/set-manifest.test | |
| +++ test/set-manifest.test | |
| @@ -125,13 +125,11 @@ | |
| 125 | # Add a tag and make sure it appears in manifest.tags |
| 126 | fossil tag add manifest-7-tag-1 tip |
| 127 | test "set-manifest-7-2" {[file_contains "manifest.tags" "^tag manifest-7-tag-1$"]} |
| 128 | |
| 129 | # Add a file and make sure tag has disappeared from manifest.tags |
| 130 | commit_file file1 "file1 contents" "Added file1." |
| 131 | test "set-manifest-7-3" {![file_contains "manifest.tags" "^tag manifest-7-tag-1$"]} |
| 132 | |
| 133 | # Add new tag and check that it is in manifest.tags |
| 134 | fossil tag add manifest-7-tag-2 tip |
| 135 | test "set-manifest-7-4" {[file_contains "manifest.tags" "^tag manifest-7-tag-2$"]} |
| @@ -139,12 +137,10 @@ | |
| 137 | |
| 138 | ##### Tags manifest branch= updates |
| 139 | |
| 140 | # Add file, create new branch on commit and check that |
| 141 | # manifest.tags has been updated appropriately |
| 142 | commit_file file3 "file3 contents" "Added file3." --branch manifest-8-branch |
| 143 | test "set-manifest-8" {[file_contains "manifest.tags" "^branch manifest-8-branch$"]} |
| 144 | |
| 145 | |
| 146 | test_cleanup |
| 147 |
+1
-3
| --- test/stash.test | ||
| +++ test/stash.test | ||
| @@ -225,13 +225,11 @@ | ||
| 225 | 225 | # behavior as fossil revert: calmly back out both the rename and the |
| 226 | 226 | # add, and presumably stash the content of the added file before it |
| 227 | 227 | # is replaced by the revert. |
| 228 | 228 | # |
| 229 | 229 | test_setup |
| 230 | -write_file f1 "f1" | |
| 231 | -fossil add f1 | |
| 232 | -fossil commit -m "add f1" | |
| 230 | +commit_file f1 "f1" "add f1" | |
| 233 | 231 | |
| 234 | 232 | write_file f1n "f1n" |
| 235 | 233 | fossil mv f1 f1n |
| 236 | 234 | write_file f1 "f1b" |
| 237 | 235 | fossil add f1 |
| 238 | 236 |
| --- test/stash.test | |
| +++ test/stash.test | |
| @@ -225,13 +225,11 @@ | |
| 225 | # behavior as fossil revert: calmly back out both the rename and the |
| 226 | # add, and presumably stash the content of the added file before it |
| 227 | # is replaced by the revert. |
| 228 | # |
| 229 | test_setup |
| 230 | write_file f1 "f1" |
| 231 | fossil add f1 |
| 232 | fossil commit -m "add f1" |
| 233 | |
| 234 | write_file f1n "f1n" |
| 235 | fossil mv f1 f1n |
| 236 | write_file f1 "f1b" |
| 237 | fossil add f1 |
| 238 |
| --- test/stash.test | |
| +++ test/stash.test | |
| @@ -225,13 +225,11 @@ | |
| 225 | # behavior as fossil revert: calmly back out both the rename and the |
| 226 | # add, and presumably stash the content of the added file before it |
| 227 | # is replaced by the revert. |
| 228 | # |
| 229 | test_setup |
| 230 | commit_file f1 "f1" "add f1" |
| 231 | |
| 232 | write_file f1n "f1n" |
| 233 | fossil mv f1 f1n |
| 234 | write_file f1 "f1b" |
| 235 | fossil add f1 |
| 236 |
+38
-9
| --- test/tester.tcl | ||
| +++ test/tester.tcl | ||
| @@ -31,11 +31,10 @@ | ||
| 31 | 31 | package require Tcl 8.6- |
| 32 | 32 | |
| 33 | 33 | set clock_start [clock milliseconds] |
| 34 | 34 | set testfiledir [file normalize [file dirname [info script]]] |
| 35 | 35 | set testrundir [pwd] |
| 36 | -set testdir [file normalize [file dirname $argv0]] | |
| 37 | 36 | set fossilexe [file normalize [lindex $argv 0]] |
| 38 | 37 | set is_windows [expr {$::tcl_platform(platform) eq "windows"}] |
| 39 | 38 | set is_cygwin [regexp {^CYGWIN} $::tcl_platform(os)] |
| 40 | 39 | |
| 41 | 40 | if {$::is_windows} { |
| @@ -63,11 +62,11 @@ | ||
| 63 | 62 | set argv [lreplace $argv $i $i] |
| 64 | 63 | } |
| 65 | 64 | } |
| 66 | 65 | |
| 67 | 66 | if {[llength $argv]==0} { |
| 68 | - foreach f [lsort [glob $testdir/*.test]] { | |
| 67 | + foreach f [lsort [glob $testfiledir/*.test]] { | |
| 69 | 68 | set base [file root [file tail $f]] |
| 70 | 69 | lappend argv $base |
| 71 | 70 | } |
| 72 | 71 | } |
| 73 | 72 | |
| @@ -220,10 +219,19 @@ | ||
| 220 | 219 | set out [open $filename w] |
| 221 | 220 | fconfigure $out -translation binary |
| 222 | 221 | puts -nonewline $out $txt |
| 223 | 222 | close $out |
| 224 | 223 | } |
| 224 | + | |
| 225 | +# Write CONTENT to the file NAME, add the file, and commit it with the | |
| 226 | +# comment MSG. ARGS are further options for "fossil commit". | |
| 227 | +# | |
| 228 | +proc commit_file {name content msg args} { | |
| 229 | + write_file $name $content | |
| 230 | + fossil add $name | |
| 231 | + fossil commit -m $msg {*}$args | |
| 232 | +} | |
| 225 | 233 | proc write_file_indented {filename txt} { |
| 226 | 234 | write_file $filename [string trim [string map [list "\n " \n] $txt]]\n |
| 227 | 235 | } |
| 228 | 236 | |
| 229 | 237 | # Returns the directory of Fossil source files that the settings come |
| @@ -303,10 +311,37 @@ | ||
| 303 | 311 | # Returns the list of all supported settings. |
| 304 | 312 | # |
| 305 | 313 | proc get_all_settings {} { |
| 306 | 314 | return [get_source_settings_in_binary 0] |
| 307 | 315 | } |
| 316 | + | |
| 317 | +# Returns the hash of the check-in of the open repository whose comment | |
| 318 | +# is COMMENT. | |
| 319 | +# | |
| 320 | +proc checkin_hash {comment} { | |
| 321 | + fossil timeline -t ci -n 0 -F {%H %c} | |
| 322 | + regexp -line "^(\[0-9a-f\]+) [string map {. \\.} $comment]\$" \ | |
| 323 | + $::RESULT -> hash | |
| 324 | + return $hash | |
| 325 | +} | |
| 326 | + | |
| 327 | +# Returns the path of the repository of the open checkout, from | |
| 328 | +# "fossil info", or an empty string when there is none. | |
| 329 | +# | |
| 330 | +proc repository_path {} { | |
| 331 | + set repository "" | |
| 332 | + regexp -line -- {^repository: (.*)$} [fossil info] -> repository | |
| 333 | + return $repository | |
| 334 | +} | |
| 335 | + | |
| 336 | +# Returns the command that runs fake-editor.tcl, for the "editor" | |
| 337 | +# setting and the VISUAL environment variable. | |
| 338 | +# | |
| 339 | +proc fake_editor_command {} { | |
| 340 | + return [appendArgs [info nameofexecutable] " " \ | |
| 341 | + [file join $::testfiledir fake-editor.tcl]] | |
| 342 | +} | |
| 308 | 343 | |
| 309 | 344 | # Returns the SHA1 hash of the file FILENAME, from "fossil sha1sum". |
| 310 | 345 | # |
| 311 | 346 | proc sha1_file {filename} { |
| 312 | 347 | return [string range [exec $::fossilexe sha1sum $filename] 0 39] |
| @@ -354,16 +389,10 @@ | ||
| 354 | 389 | return [string match "$a*" $b] |
| 355 | 390 | } |
| 356 | 391 | return [string match "$b*" $a] |
| 357 | 392 | } |
| 358 | 393 | |
| 359 | -# Return a prefix of a uuid, defaulting to 10 chars. | |
| 360 | -# | |
| 361 | -proc short_uuid {uuid {len 10}} { | |
| 362 | - string range $uuid 0 $len-1 | |
| 363 | -} | |
| 364 | - | |
| 365 | 394 | |
| 366 | 395 | proc require_no_open_checkout {} { |
| 367 | 396 | if {[info exists ::env(FOSSIL_TEST_DANGEROUS_IGNORE_OPEN_CHECKOUT)] && \ |
| 368 | 397 | $::env(FOSSIL_TEST_DANGEROUS_IGNORE_OPEN_CHECKOUT) eq "YES_DO_IT"} { |
| 369 | 398 | return |
| @@ -1108,11 +1137,11 @@ | ||
| 1108 | 1137 | set startPwd [pwd] |
| 1109 | 1138 | cd $tempHomePath |
| 1110 | 1139 | |
| 1111 | 1140 | foreach testfile $argv { |
| 1112 | 1141 | protOut "***** $testfile ******" |
| 1113 | - if { [catch {source $testdir/$testfile.test} testerror testopts] } { | |
| 1142 | + if { [catch {source $testfiledir/$testfile.test} testerror testopts] } { | |
| 1114 | 1143 | test_report test-framework-$testfile 0 "" [list "error: $testerror"] |
| 1115 | 1144 | protOut "!!!!! $testfile: $testerror" |
| 1116 | 1145 | protOutDict $testopts |
| 1117 | 1146 | # A test file that raises an error stops before its own test_cleanup, |
| 1118 | 1147 | # and the directories it leaves make the next file's test_cleanup fail. |
| 1119 | 1148 |
| --- test/tester.tcl | |
| +++ test/tester.tcl | |
| @@ -31,11 +31,10 @@ | |
| 31 | package require Tcl 8.6- |
| 32 | |
| 33 | set clock_start [clock milliseconds] |
| 34 | set testfiledir [file normalize [file dirname [info script]]] |
| 35 | set testrundir [pwd] |
| 36 | set testdir [file normalize [file dirname $argv0]] |
| 37 | set fossilexe [file normalize [lindex $argv 0]] |
| 38 | set is_windows [expr {$::tcl_platform(platform) eq "windows"}] |
| 39 | set is_cygwin [regexp {^CYGWIN} $::tcl_platform(os)] |
| 40 | |
| 41 | if {$::is_windows} { |
| @@ -63,11 +62,11 @@ | |
| 63 | set argv [lreplace $argv $i $i] |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | if {[llength $argv]==0} { |
| 68 | foreach f [lsort [glob $testdir/*.test]] { |
| 69 | set base [file root [file tail $f]] |
| 70 | lappend argv $base |
| 71 | } |
| 72 | } |
| 73 | |
| @@ -220,10 +219,19 @@ | |
| 220 | set out [open $filename w] |
| 221 | fconfigure $out -translation binary |
| 222 | puts -nonewline $out $txt |
| 223 | close $out |
| 224 | } |
| 225 | proc write_file_indented {filename txt} { |
| 226 | write_file $filename [string trim [string map [list "\n " \n] $txt]]\n |
| 227 | } |
| 228 | |
| 229 | # Returns the directory of Fossil source files that the settings come |
| @@ -303,10 +311,37 @@ | |
| 303 | # Returns the list of all supported settings. |
| 304 | # |
| 305 | proc get_all_settings {} { |
| 306 | return [get_source_settings_in_binary 0] |
| 307 | } |
| 308 | |
| 309 | # Returns the SHA1 hash of the file FILENAME, from "fossil sha1sum". |
| 310 | # |
| 311 | proc sha1_file {filename} { |
| 312 | return [string range [exec $::fossilexe sha1sum $filename] 0 39] |
| @@ -354,16 +389,10 @@ | |
| 354 | return [string match "$a*" $b] |
| 355 | } |
| 356 | return [string match "$b*" $a] |
| 357 | } |
| 358 | |
| 359 | # Return a prefix of a uuid, defaulting to 10 chars. |
| 360 | # |
| 361 | proc short_uuid {uuid {len 10}} { |
| 362 | string range $uuid 0 $len-1 |
| 363 | } |
| 364 | |
| 365 | |
| 366 | proc require_no_open_checkout {} { |
| 367 | if {[info exists ::env(FOSSIL_TEST_DANGEROUS_IGNORE_OPEN_CHECKOUT)] && \ |
| 368 | $::env(FOSSIL_TEST_DANGEROUS_IGNORE_OPEN_CHECKOUT) eq "YES_DO_IT"} { |
| 369 | return |
| @@ -1108,11 +1137,11 @@ | |
| 1108 | set startPwd [pwd] |
| 1109 | cd $tempHomePath |
| 1110 | |
| 1111 | foreach testfile $argv { |
| 1112 | protOut "***** $testfile ******" |
| 1113 | if { [catch {source $testdir/$testfile.test} testerror testopts] } { |
| 1114 | test_report test-framework-$testfile 0 "" [list "error: $testerror"] |
| 1115 | protOut "!!!!! $testfile: $testerror" |
| 1116 | protOutDict $testopts |
| 1117 | # A test file that raises an error stops before its own test_cleanup, |
| 1118 | # and the directories it leaves make the next file's test_cleanup fail. |
| 1119 |
| --- test/tester.tcl | |
| +++ test/tester.tcl | |
| @@ -31,11 +31,10 @@ | |
| 31 | package require Tcl 8.6- |
| 32 | |
| 33 | set clock_start [clock milliseconds] |
| 34 | set testfiledir [file normalize [file dirname [info script]]] |
| 35 | set testrundir [pwd] |
| 36 | set fossilexe [file normalize [lindex $argv 0]] |
| 37 | set is_windows [expr {$::tcl_platform(platform) eq "windows"}] |
| 38 | set is_cygwin [regexp {^CYGWIN} $::tcl_platform(os)] |
| 39 | |
| 40 | if {$::is_windows} { |
| @@ -63,11 +62,11 @@ | |
| 62 | set argv [lreplace $argv $i $i] |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | if {[llength $argv]==0} { |
| 67 | foreach f [lsort [glob $testfiledir/*.test]] { |
| 68 | set base [file root [file tail $f]] |
| 69 | lappend argv $base |
| 70 | } |
| 71 | } |
| 72 | |
| @@ -220,10 +219,19 @@ | |
| 219 | set out [open $filename w] |
| 220 | fconfigure $out -translation binary |
| 221 | puts -nonewline $out $txt |
| 222 | close $out |
| 223 | } |
| 224 | |
| 225 | # Write CONTENT to the file NAME, add the file, and commit it with the |
| 226 | # comment MSG. ARGS are further options for "fossil commit". |
| 227 | # |
| 228 | proc commit_file {name content msg args} { |
| 229 | write_file $name $content |
| 230 | fossil add $name |
| 231 | fossil commit -m $msg {*}$args |
| 232 | } |
| 233 | proc write_file_indented {filename txt} { |
| 234 | write_file $filename [string trim [string map [list "\n " \n] $txt]]\n |
| 235 | } |
| 236 | |
| 237 | # Returns the directory of Fossil source files that the settings come |
| @@ -303,10 +311,37 @@ | |
| 311 | # Returns the list of all supported settings. |
| 312 | # |
| 313 | proc get_all_settings {} { |
| 314 | return [get_source_settings_in_binary 0] |
| 315 | } |
| 316 | |
| 317 | # Returns the hash of the check-in of the open repository whose comment |
| 318 | # is COMMENT. |
| 319 | # |
| 320 | proc checkin_hash {comment} { |
| 321 | fossil timeline -t ci -n 0 -F {%H %c} |
| 322 | regexp -line "^(\[0-9a-f\]+) [string map {. \\.} $comment]\$" \ |
| 323 | $::RESULT -> hash |
| 324 | return $hash |
| 325 | } |
| 326 | |
| 327 | # Returns the path of the repository of the open checkout, from |
| 328 | # "fossil info", or an empty string when there is none. |
| 329 | # |
| 330 | proc repository_path {} { |
| 331 | set repository "" |
| 332 | regexp -line -- {^repository: (.*)$} [fossil info] -> repository |
| 333 | return $repository |
| 334 | } |
| 335 | |
| 336 | # Returns the command that runs fake-editor.tcl, for the "editor" |
| 337 | # setting and the VISUAL environment variable. |
| 338 | # |
| 339 | proc fake_editor_command {} { |
| 340 | return [appendArgs [info nameofexecutable] " " \ |
| 341 | [file join $::testfiledir fake-editor.tcl]] |
| 342 | } |
| 343 | |
| 344 | # Returns the SHA1 hash of the file FILENAME, from "fossil sha1sum". |
| 345 | # |
| 346 | proc sha1_file {filename} { |
| 347 | return [string range [exec $::fossilexe sha1sum $filename] 0 39] |
| @@ -354,16 +389,10 @@ | |
| 389 | return [string match "$a*" $b] |
| 390 | } |
| 391 | return [string match "$b*" $a] |
| 392 | } |
| 393 | |
| 394 | |
| 395 | proc require_no_open_checkout {} { |
| 396 | if {[info exists ::env(FOSSIL_TEST_DANGEROUS_IGNORE_OPEN_CHECKOUT)] && \ |
| 397 | $::env(FOSSIL_TEST_DANGEROUS_IGNORE_OPEN_CHECKOUT) eq "YES_DO_IT"} { |
| 398 | return |
| @@ -1108,11 +1137,11 @@ | |
| 1137 | set startPwd [pwd] |
| 1138 | cd $tempHomePath |
| 1139 | |
| 1140 | foreach testfile $argv { |
| 1141 | protOut "***** $testfile ******" |
| 1142 | if { [catch {source $testfiledir/$testfile.test} testerror testopts] } { |
| 1143 | test_report test-framework-$testfile 0 "" [list "error: $testerror"] |
| 1144 | protOut "!!!!! $testfile: $testerror" |
| 1145 | protOutDict $testopts |
| 1146 | # A test file that raises an error stops before its own test_cleanup, |
| 1147 | # and the directories it leaves make the next file's test_cleanup fail. |
| 1148 |
+3
-5
| --- test/th1-docs.test | ||
| +++ test/th1-docs.test | ||
| @@ -39,20 +39,18 @@ | ||
| 39 | 39 | set env(TH1_ENABLE_DOCS) 1; # TH1 docs must be enabled for this test. |
| 40 | 40 | set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test. |
| 41 | 41 | |
| 42 | 42 | ############################################################################### |
| 43 | 43 | |
| 44 | -set data [fossil info] | |
| 45 | - | |
| 46 | -regexp -line -- {^repository: (.*)$} $data dummy repository | |
| 44 | +set repository [repository_path] | |
| 47 | 45 | |
| 48 | 46 | if {[string length $repository] == 0 || ![file exists $repository]} { |
| 49 | 47 | error "unable to locate repository" |
| 50 | 48 | } |
| 51 | 49 | |
| 52 | -set dataFileName [file join $::testdir th1-docs-input.txt] | |
| 53 | -set origFileStat [file join $::testdir fileStat.th1] | |
| 50 | +set dataFileName [file join $::testfiledir th1-docs-input.txt] | |
| 51 | +set origFileStat [file join $::testfiledir fileStat.th1] | |
| 54 | 52 | |
| 55 | 53 | if {![file exists $origFileStat]} { |
| 56 | 54 | error "unable to locate [$origFileStat]" |
| 57 | 55 | } |
| 58 | 56 | |
| 59 | 57 |
| --- test/th1-docs.test | |
| +++ test/th1-docs.test | |
| @@ -39,20 +39,18 @@ | |
| 39 | set env(TH1_ENABLE_DOCS) 1; # TH1 docs must be enabled for this test. |
| 40 | set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test. |
| 41 | |
| 42 | ############################################################################### |
| 43 | |
| 44 | set data [fossil info] |
| 45 | |
| 46 | regexp -line -- {^repository: (.*)$} $data dummy repository |
| 47 | |
| 48 | if {[string length $repository] == 0 || ![file exists $repository]} { |
| 49 | error "unable to locate repository" |
| 50 | } |
| 51 | |
| 52 | set dataFileName [file join $::testdir th1-docs-input.txt] |
| 53 | set origFileStat [file join $::testdir fileStat.th1] |
| 54 | |
| 55 | if {![file exists $origFileStat]} { |
| 56 | error "unable to locate [$origFileStat]" |
| 57 | } |
| 58 | |
| 59 |
| --- test/th1-docs.test | |
| +++ test/th1-docs.test | |
| @@ -39,20 +39,18 @@ | |
| 39 | set env(TH1_ENABLE_DOCS) 1; # TH1 docs must be enabled for this test. |
| 40 | set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test. |
| 41 | |
| 42 | ############################################################################### |
| 43 | |
| 44 | set repository [repository_path] |
| 45 | |
| 46 | if {[string length $repository] == 0 || ![file exists $repository]} { |
| 47 | error "unable to locate repository" |
| 48 | } |
| 49 | |
| 50 | set dataFileName [file join $::testfiledir th1-docs-input.txt] |
| 51 | set origFileStat [file join $::testfiledir fileStat.th1] |
| 52 | |
| 53 | if {![file exists $origFileStat]} { |
| 54 | error "unable to locate [$origFileStat]" |
| 55 | } |
| 56 | |
| 57 |
+2
-3
| --- test/th1-hooks.test | ||
| +++ test/th1-hooks.test | ||
| @@ -114,18 +114,17 @@ | ||
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | ############################################################################### |
| 118 | 118 | |
| 119 | -set data [fossil info] | |
| 120 | -regexp -line -- {^repository: (.*)$} $data dummy repository | |
| 119 | +set repository [repository_path] | |
| 121 | 120 | |
| 122 | 121 | if {[string length $repository] == 0 || ![file exists $repository]} { |
| 123 | 122 | error "unable to locate repository" |
| 124 | 123 | } |
| 125 | 124 | |
| 126 | -set dataFileName [file join $::testdir th1-hooks-input.txt] | |
| 125 | +set dataFileName [file join $::testfiledir th1-hooks-input.txt] | |
| 127 | 126 | |
| 128 | 127 | ############################################################################### |
| 129 | 128 | |
| 130 | 129 | set savedTh1Setup [fossil settings th1-setup] |
| 131 | 130 | fossil settings th1-setup $testTh1Setup |
| 132 | 131 |
| --- test/th1-hooks.test | |
| +++ test/th1-hooks.test | |
| @@ -114,18 +114,17 @@ | |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | ############################################################################### |
| 118 | |
| 119 | set data [fossil info] |
| 120 | regexp -line -- {^repository: (.*)$} $data dummy repository |
| 121 | |
| 122 | if {[string length $repository] == 0 || ![file exists $repository]} { |
| 123 | error "unable to locate repository" |
| 124 | } |
| 125 | |
| 126 | set dataFileName [file join $::testdir th1-hooks-input.txt] |
| 127 | |
| 128 | ############################################################################### |
| 129 | |
| 130 | set savedTh1Setup [fossil settings th1-setup] |
| 131 | fossil settings th1-setup $testTh1Setup |
| 132 |
| --- test/th1-hooks.test | |
| +++ test/th1-hooks.test | |
| @@ -114,18 +114,17 @@ | |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | ############################################################################### |
| 118 | |
| 119 | set repository [repository_path] |
| 120 | |
| 121 | if {[string length $repository] == 0 || ![file exists $repository]} { |
| 122 | error "unable to locate repository" |
| 123 | } |
| 124 | |
| 125 | set dataFileName [file join $::testfiledir th1-hooks-input.txt] |
| 126 | |
| 127 | ############################################################################### |
| 128 | |
| 129 | set savedTh1Setup [fossil settings th1-setup] |
| 130 | fossil settings th1-setup $testTh1Setup |
| 131 |
+1
-2
| --- test/unversioned.test | ||
| +++ test/unversioned.test | ||
| @@ -39,12 +39,11 @@ | ||
| 39 | 39 | write_file unversioned2.txt " This is unversioned file #2. " |
| 40 | 40 | write_file "unversioned space.txt" "\nThis is unversioned file #3.\n" |
| 41 | 41 | write_file unversioned4.txt "This is unversioned file #4." |
| 42 | 42 | write_file unversioned5.txt "This is unversioned file #5." |
| 43 | 43 | |
| 44 | -set env(VISUAL) [appendArgs \ | |
| 45 | - [info nameofexecutable] " " [file join $path fake-editor.tcl]] | |
| 44 | +set env(VISUAL) [fake_editor_command] | |
| 46 | 45 | |
| 47 | 46 | ############################################################################### |
| 48 | 47 | |
| 49 | 48 | # Under cygwin, the printed name with Usage: strips the extension |
| 50 | 49 | if { $::is_cygwin && [file extension $fossilexe] eq ".exe" } { |
| 51 | 50 |
| --- test/unversioned.test | |
| +++ test/unversioned.test | |
| @@ -39,12 +39,11 @@ | |
| 39 | write_file unversioned2.txt " This is unversioned file #2. " |
| 40 | write_file "unversioned space.txt" "\nThis is unversioned file #3.\n" |
| 41 | write_file unversioned4.txt "This is unversioned file #4." |
| 42 | write_file unversioned5.txt "This is unversioned file #5." |
| 43 | |
| 44 | set env(VISUAL) [appendArgs \ |
| 45 | [info nameofexecutable] " " [file join $path fake-editor.tcl]] |
| 46 | |
| 47 | ############################################################################### |
| 48 | |
| 49 | # Under cygwin, the printed name with Usage: strips the extension |
| 50 | if { $::is_cygwin && [file extension $fossilexe] eq ".exe" } { |
| 51 |
| --- test/unversioned.test | |
| +++ test/unversioned.test | |
| @@ -39,12 +39,11 @@ | |
| 39 | write_file unversioned2.txt " This is unversioned file #2. " |
| 40 | write_file "unversioned space.txt" "\nThis is unversioned file #3.\n" |
| 41 | write_file unversioned4.txt "This is unversioned file #4." |
| 42 | write_file unversioned5.txt "This is unversioned file #5." |
| 43 | |
| 44 | set env(VISUAL) [fake_editor_command] |
| 45 | |
| 46 | ############################################################################### |
| 47 | |
| 48 | # Under cygwin, the printed name with Usage: strips the extension |
| 49 | if { $::is_cygwin && [file extension $fossilexe] eq ".exe" } { |
| 50 |
+2
-6
| --- test/update.test | ||
| +++ test/update.test | ||
| @@ -173,13 +173,11 @@ | ||
| 173 | 173 | |
| 174 | 174 | set testname "merge-renamed" |
| 175 | 175 | set fname [test_update_setup $testname] |
| 176 | 176 | set message "MERGE $fname -> $fname.renamed" |
| 177 | 177 | set changes "EDITED $fname.renamed" |
| 178 | -write_file $fname "center\n" | |
| 179 | -fossil add $fname | |
| 180 | -fossil commit -m "Add $fname" | |
| 178 | +commit_file $fname "center\n" "Add $fname" | |
| 181 | 179 | write_file $fname "top\ncenter\n" |
| 182 | 180 | fossil mv --hard $fname "$fname.renamed" |
| 183 | 181 | fossil commit -m "Update and rename $fname" |
| 184 | 182 | fossil up previous |
| 185 | 183 | write_file $fname "center\nbelow\n" |
| @@ -187,13 +185,11 @@ | ||
| 187 | 185 | |
| 188 | 186 | set testname "merge-standard" |
| 189 | 187 | set fname [test_update_setup $testname] |
| 190 | 188 | set message "MERGE $fname" |
| 191 | 189 | set changes "EDITED $fname" |
| 192 | -write_file $fname "center\n" | |
| 193 | -fossil add $fname | |
| 194 | -fossil commit -m "Add $fname" | |
| 190 | +commit_file $fname "center\n" "Add $fname" | |
| 195 | 191 | write_file $fname "top\ncenter\n" |
| 196 | 192 | fossil commit -m "Update $fname" |
| 197 | 193 | fossil up previous |
| 198 | 194 | write_file $fname "center\nbelow\n" |
| 199 | 195 | test_update $testname $message $changes |
| 200 | 196 |
| --- test/update.test | |
| +++ test/update.test | |
| @@ -173,13 +173,11 @@ | |
| 173 | |
| 174 | set testname "merge-renamed" |
| 175 | set fname [test_update_setup $testname] |
| 176 | set message "MERGE $fname -> $fname.renamed" |
| 177 | set changes "EDITED $fname.renamed" |
| 178 | write_file $fname "center\n" |
| 179 | fossil add $fname |
| 180 | fossil commit -m "Add $fname" |
| 181 | write_file $fname "top\ncenter\n" |
| 182 | fossil mv --hard $fname "$fname.renamed" |
| 183 | fossil commit -m "Update and rename $fname" |
| 184 | fossil up previous |
| 185 | write_file $fname "center\nbelow\n" |
| @@ -187,13 +185,11 @@ | |
| 187 | |
| 188 | set testname "merge-standard" |
| 189 | set fname [test_update_setup $testname] |
| 190 | set message "MERGE $fname" |
| 191 | set changes "EDITED $fname" |
| 192 | write_file $fname "center\n" |
| 193 | fossil add $fname |
| 194 | fossil commit -m "Add $fname" |
| 195 | write_file $fname "top\ncenter\n" |
| 196 | fossil commit -m "Update $fname" |
| 197 | fossil up previous |
| 198 | write_file $fname "center\nbelow\n" |
| 199 | test_update $testname $message $changes |
| 200 |
| --- test/update.test | |
| +++ test/update.test | |
| @@ -173,13 +173,11 @@ | |
| 173 | |
| 174 | set testname "merge-renamed" |
| 175 | set fname [test_update_setup $testname] |
| 176 | set message "MERGE $fname -> $fname.renamed" |
| 177 | set changes "EDITED $fname.renamed" |
| 178 | commit_file $fname "center\n" "Add $fname" |
| 179 | write_file $fname "top\ncenter\n" |
| 180 | fossil mv --hard $fname "$fname.renamed" |
| 181 | fossil commit -m "Update and rename $fname" |
| 182 | fossil up previous |
| 183 | write_file $fname "center\nbelow\n" |
| @@ -187,13 +185,11 @@ | |
| 185 | |
| 186 | set testname "merge-standard" |
| 187 | set fname [test_update_setup $testname] |
| 188 | set message "MERGE $fname" |
| 189 | set changes "EDITED $fname" |
| 190 | commit_file $fname "center\n" "Add $fname" |
| 191 | write_file $fname "top\ncenter\n" |
| 192 | fossil commit -m "Update $fname" |
| 193 | fossil up previous |
| 194 | write_file $fname "center\nbelow\n" |
| 195 | test_update $testname $message $changes |
| 196 |