Fossil SCM

Remove duplicated and unused variables, create shared helpers for calling the fossil binary consistently from all tests.

danshearer 2026-11-20 10:23 UTC test-suite-new
Commit 123dee37b393735326234f46cb754c15a2cc5ef8c441f59d28449dd3d1f033c3
+3 -6
--- test/amend.test
+++ test/amend.test
@@ -53,13 +53,11 @@
5353
5454
if {![uuid_from_checkout HASHINIT]} {
5555
test_fail_then_return amend-checkout-failure \
5656
"could not read the check-out's hash"
5757
}
58
-write_file datafile "data"
59
-fossil add datafile
60
-fossil commit -m "c1"
58
+commit_file datafile "data" "c1"
6159
if {![uuid_from_commit $RESULT HASH]} {
6260
test_fail_then_return amend-setup-failure \
6361
"could not read the hash of the first commit: $RESULT"
6462
}
6563
@@ -356,11 +354,11 @@
356354
if {$VERBOSE} { protOut "No artifact found in timeline output: $RESULT" }
357355
test amend-comment-$name.2 false
358356
}
359357
fossil timeline -n 1
360358
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]
362360
}
363361
fossil info $HASH
364362
test amend-comment-$name.4 {
365363
[string match "*hash:*$HASH*comment:*$comment*" $RESULT]
366364
}
@@ -383,12 +381,11 @@
383381
write_file commitmsg "revision 4 revised with -M"
384382
fossil amend $HASH -M commitmsg
385383
test-comment 4 $HASH "revision 4 revised with -M"
386384
387385
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]
390387
set comment "interactive edited comment"
391388
set env(FAKE_EDITOR_SCRIPT) [list set data $comment]
392389
fossil amend $HASH --edit-comment
393390
unset env(FAKE_EDITOR_SCRIPT)
394391
test-comment 5 $HASH $comment
395392
--- 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
--- test/branch-tag.test
+++ test/branch-tag.test
@@ -21,19 +21,10 @@
2121
2222
set path [file dirname [info script]]
2323
2424
require_no_open_checkout
2525
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
-
3526
# Returns the hash of the current check-out.
3627
#
3728
proc branchtag_current {} {
3829
fossil timeline before current -n 1 -t ci -F %H
3930
return [first_data_line]
@@ -50,17 +41,15 @@
5041
return [lsort $lines]
5142
}
5243
5344
test_setup
5445
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]
5948
write_file a.txt "a2\n"
6049
fossil commit -m "bt-c2"
61
-set c2 [branchtag_hash bt-c2]
50
+set c2 [checkin_hash bt-c2]
6251
6352
###############################################################################
6453
#
6554
# A new branch is listed as open, and a check-in on it stays on it.
6655
#
6756
--- 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 @@
2525
fossil extra
2626
test clean-0 {[normalize_result] eq {}}
2727
2828
###############################################################################
2929
30
-write_file f1 "f1 line"
31
-fossil add f1
32
-fossil commit -m "base file"
30
+commit_file f1 "f1 line" "base file"
3331
fossil ls
3432
test clean-1 {[normalize_result] eq {f1}}
3533
3634
###############################################################################
3735
3836
--- 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
--- test/commit-warning.test
+++ test/commit-warning.test
@@ -100,12 +100,12 @@
100100
set bomBE "\xfe\xff"
101101
write_file utf-16le-bomle-hello "$bomLE$hello16LE"
102102
write_file utf-16be-bombe-hello "$bomBE$hello16BE"
103103
write_file utf-16le-bombe-hello "$bomBE$hello16LE"
104104
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]]
107107
write_file utf-16le.txt $le16
108108
write_file utf-16be.txt $be16
109109
write_file utf-nobom-16le.txt [string range $le16 2 end]
110110
write_file utf-nobom-16be.txt [string range $be16 2 end]
111111
#write_file [file join $::env(TEMP) utf-nobom-16le.txt] [string range $le16 2 end]
112112
--- 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
--- test/merge-history.test
+++ test/merge-history.test
@@ -23,20 +23,10 @@
2323
2424
set path [file dirname [info script]]
2525
2626
require_no_open_checkout
2727
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
-
3828
# Returns the P-card and Q-cards of the manifest of CHECKIN as a list of
3929
# lines.
4030
#
4131
proc mergehist_cards {checkin} {
4232
fossil artifact $checkin
@@ -56,28 +46,24 @@
5646
return $lines
5747
}
5848
5949
test_setup
6050
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]
6553
6654
write_file a.txt "1\n2-trunk\n3\n4\n5\n"
6755
fossil commit -m "mh-c2" --user-override bob
68
-set c2 [mergehist_hash mh-c2]
56
+set c2 [checkin_hash mh-c2]
6957
7058
fossil update $c1
7159
write_file a.txt "1\n2\n3\n4-feature\n5\n"
7260
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]
7462
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]
7965
8066
###############################################################################
8167
#
8268
# "fossil merge --cherrypick" applies the changes of one check-in: the
8369
# edit of f1 and not the line and file that f2 adds. The check-in that
@@ -84,11 +70,11 @@
8470
# follows has one parent and a Q-card "+F1".
8571
#
8672
fossil update trunk
8773
fossil merge --cherrypick $f1
8874
fossil commit -m "mh-pick" --user-override dave
89
-set pick [mergehist_hash mh-pick]
75
+set pick [checkin_hash mh-pick]
9076
9177
test_eq merge-history-cherrypick-content [read_file a.txt] \
9278
"1\n2-trunk\n3\n4-feature\n5\n"
9379
test_eq merge-history-cherrypick-no-g [file exists g.txt] 0
9480
test_eq merge-history-cherrypick-cards [mergehist_cards $pick] \
@@ -101,11 +87,11 @@
10187
# Q-card "-C2". A backout of the parent itself is recorded without a
10288
# Q-card, so these tests back out an earlier check-in.
10389
#
10490
fossil merge --backout $c2
10591
fossil commit -m "mh-backout" --user-override erin
106
-set backout [mergehist_hash mh-backout]
92
+set backout [checkin_hash mh-backout]
10793
10894
test_eq merge-history-backout-content [read_file a.txt] \
10995
"1\n2\n3\n4-feature\n5\n"
11096
test_eq merge-history-backout-cards [mergehist_cards $backout] \
11197
[list "P $pick" "Q -$c2"]
@@ -115,11 +101,11 @@
115101
# A full merge of the branch brings in both of its check-ins, and the
116102
# check-in that follows has two parents.
117103
#
118104
fossil merge mh-feature
119105
fossil commit -m "mh-merge" --user-override frank
120
-set merge [mergehist_hash mh-merge]
106
+set merge [checkin_hash mh-merge]
121107
122108
test_eq merge-history-merge-content [read_file a.txt] \
123109
"1\n2\n3\n4-feature\n5\n6-feature\n"
124110
test_eq merge-history-merge-g [read_file g.txt] "g\n"
125111
test_eq merge-history-merge-cards [mergehist_cards $merge] \
126112
--- 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
--- test/merge5.test
+++ test/merge5.test
@@ -44,11 +44,11 @@
4444
4545
require_no_open_checkout; test_setup ""
4646
4747
# Construct a test repository
4848
#
49
-exec $::fossilexe sqlite3 --no-repository m5.fossil <$testdir/${testfile}_repo.sql
49
+exec $::fossilexe sqlite3 --no-repository m5.fossil <$testfiledir/${testfile}_repo.sql
5050
fossil rebuild m5.fossil
5151
fossil open m5.fossil
5252
fossil user default drh --user drh
5353
fossil update baseline
5454
checkout-test 10 {
5555
--- 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
--- test/merge6.test
+++ test/merge6.test
@@ -25,21 +25,17 @@
2525
test_setup
2626
fossil ls
2727
2828
test merge_multi-0 {[normalize_result] eq {}}
2929
30
-write_file f1 "f1 line"
31
-fossil add f1
32
-fossil commit -m "base file"
30
+commit_file f1 "f1 line" "base file"
3331
fossil ls
3432
3533
test merge_multi-1 {[normalize_result] eq {f1}}
3634
3735
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
4137
fossil ls
4238
4339
test merge_multi-2 {[normalize_result] eq {f1
4440
f2}}
4541
4642
--- 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
--- test/merge_renames.test
+++ test/merge_renames.test
@@ -15,13 +15,11 @@
1515
# Reported: Ticket [554f44ee74e3d] #
1616
######################################
1717
1818
test_setup
1919
20
-write_file f1 "line"
21
-fossil add f1
22
-fossil commit -m "c1"
20
+commit_file f1 "line" "c1"
2321
fossil tag add pivot current
2422
2523
write_file f1 "line2"
2624
fossil commit -m "c2"
2725
@@ -57,18 +55,14 @@
5755
# Reported: Ticket [74413366fe5067] #
5856
######################################
5957
6058
test_setup
6159
62
-write_file f1 "line"
63
-fossil add f1
64
-fossil commit -m "base file"
60
+commit_file f1 "line" "base file"
6561
fossil tag add pivot current
6662
67
-write_file f2 "line2"
68
-fossil add f2
69
-fossil commit -m "newfile"
63
+commit_file f2 "line2" "newfile"
7064
7165
fossil mv --hard f2 f2new
7266
fossil commit -m "rename"
7367
7468
fossil update pivot
@@ -88,18 +82,14 @@
8882
# Reported: Ticket [30b28cf351] #
8983
######################################
9084
9185
test_setup
9286
93
-write_file f1 "line"
94
-fossil add f1
95
-fossil commit -m "base file"
87
+commit_file f1 "line" "base file"
9688
fossil tag add pivot current
9789
98
-write_file f2 "line2"
99
-fossil add f2
100
-fossil commit -m "newfile"
90
+commit_file f2 "line2" "newfile"
10191
10292
fossil mv --hard f2 f2new
10393
fossil commit -m "rename"
10494
10595
fossil update pivot
@@ -119,13 +109,11 @@
119109
# Reported: Ticket [67176c3aa4] #
120110
######################################
121111
122112
test_setup
123113
124
-write_file f1 "f1"
125
-fossil add f1
126
-fossil commit -m "add f1"
114
+commit_file f1 "f1" "add f1"
127115
128116
write_file f1 "f1.1"
129117
fossil commit --branch b -m "change f1"
130118
131119
fossil update trunk
@@ -141,23 +129,17 @@
141129
# Handle Rename/Add via Merge #
142130
######################################
143131
144132
test_setup
145133
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"
149135
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
153137
154138
fossil update trunk
155139
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"
159141
160142
fossil update branch_for_f3
161143
fossil merge trunk
162144
test_status_list merge_renames-5-1 $RESULT {
163145
RENAME f1 -> f2
@@ -177,13 +159,11 @@
177159
# Merging a branch multiple times #
178160
#####################################
179161
180162
test_setup
181163
182
-write_file f1 "f1"
183
-fossil add f1
184
-fossil commit -m "add f1"
164
+commit_file f1 "f1" "add f1"
185165
186166
fossil mv --hard f1 f2
187167
fossil commit -b b -m "f1 -> f2"
188168
189169
fossil update trunk
@@ -227,13 +207,11 @@
227207
# in the merged branch and adding a new file with the original name #
228208
########################################################################
229209
230210
test_setup
231211
232
-write_file f1 "f1"
233
-fossil add f1
234
-fossil commit -m "add f1"
212
+commit_file f1 "f1" "add f1"
235213
236214
fossil mv --hard f1 f2
237215
write_file f2 "f2"
238216
fossil commit -b b -m "f1 -> f2, edit f2"
239217
@@ -294,13 +272,11 @@
294272
fossil commit -b b -m "delete f2"
295273
296274
fossil mv --hard f1 f2
297275
fossil commit -m "f1 -> f2"
298276
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"
302278
303279
fossil update trunk
304280
fossil merge b
305281
set expectedMerge {
306282
DELETE f2
@@ -392,13 +368,11 @@
392368
# Specifying a baseline #
393369
############################################
394370
395371
test_setup
396372
397
-write_file f1 "line"
398
-fossil add f1
399
-fossil commit -m "add f1"
373
+commit_file f1 "line" "add f1"
400374
401375
write_file f1 "line\nline2"
402376
fossil commit -b b -m "edit f2" --tag p1
403377
404378
fossil mv --hard f1 f2
@@ -428,13 +402,11 @@
428402
# of either the checked-out commit or the commit being merged #
429403
#################################################################
430404
431405
test_setup
432406
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
436408
437409
fossil mv --hard f1 f1n
438410
fossil commit -m "f1 -> f1n"
439411
440412
fossil mv --hard f1n f1v
@@ -475,17 +447,13 @@
475447
# Merge in add+rename that happened on a branch, then merged #
476448
# back to branch, and again to trunk, then merge in branch. #
477449
#################################################################
478450
479451
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
483453
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
487455
fossil update trunk
488456
test_status_list merge_renames_13-1 $RESULT {REMOVE f2}
489457
write_file f1 "line1\nline2\n"
490458
fossil commit -m "edit f1 on trunk" --tag c3
491459
492460
--- 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
--- test/merge_renames_2.test
+++ test/merge_renames_2.test
@@ -1,31 +1,22 @@
11
#
22
# Tests for merging with renames
33
#
44
#
55
6
-proc commit_id {version} {
7
- regexp -line {^artifact:\s+(\S+)} [fossil whatis $version] - id
8
- return $id
9
-}
10
-
116
require_no_open_checkout
127
138
#################################################################
149
# Test 1 #
1510
# https://fossil-scm.org/forum/forumpost/549700437b #
1611
#################################################################
1712
1813
test_setup
1914
20
-write_file file1 "file1\n"
21
-fossil add file1
22
-fossil commit -m "added file1"
15
+commit_file file1 "file1\n" "added file1"
2316
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
2718
2819
write_file file2 "edit file2 on added\n"
2920
fossil commit -m "edited file2"
3021
3122
fossil mv --hard file2 file2.renamed
3223
--- 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
--- test/merge_warn.test
+++ test/merge_warn.test
@@ -18,28 +18,22 @@
1818
# Testing "merge" command warnings
1919
#
2020
2121
test_setup
2222
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
2624
27
-write_file f2 "f2"
28
-fossil add f2
29
-fossil commit -m "add f2"
25
+commit_file f2 "f2" "add f2"
3026
3127
fossil update pivot
3228
fossil rm --hard f1
3329
write_file f2 "f2.1"
3430
write_file f3 "f3"
3531
fossil add f2 f3
3632
fossil commit -b b -m "delete f1, add f2 and f3" --tag mrg
3733
38
-write_file f4 "f4"
39
-fossil add f4
40
-fossil commit -m "add f4"
34
+commit_file f4 "f4" "add f4"
4135
4236
fossil update trunk
4337
write_file f1 "f1.1"
4438
write_file f3 "f3.1"
4539
fossil merge --integrate mrg -expectError
4640
--- 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
--- test/revert.test
+++ test/revert.test
@@ -158,13 +158,11 @@
158158
159159
# Test reverting the combination of a renamed file and an added file that
160160
# uses the renamed file's original filename.
161161
#
162162
test_setup
163
-write_file f1 "f1"
164
-fossil add f1
165
-fossil commit -m "add f1"
163
+commit_file f1 "f1" "add f1"
166164
167165
write_file f1n "f1n"
168166
fossil mv f1 f1n
169167
write_file f1 "f1b"
170168
fossil add f1
@@ -176,13 +174,11 @@
176174
177175
178176
# Test reverting a rename in the repo but not completed in the file
179177
# system
180178
test_setup
181
-write_file f1 "f1"
182
-fossil add f1
183
-fossil commit -m "add f1"
179
+commit_file f1 "f1" "add f1"
184180
fossil mv --soft f1 f1new
185181
test 3-mv-1 {[file exists f1]}
186182
test 3-mv-2 {![file exists f1new]}
187183
revert-test 3-1 {} {
188184
REVERT f1
189185
--- 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
--- test/roundtrip.test
+++ test/roundtrip.test
@@ -161,13 +161,11 @@
161161
write_file noeol.txt "no newline"
162162
fossil add a.txt b.txt sub noeol.txt
163163
fossil commit -m "rt-c1"
164164
165165
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"
169167
170168
fossil branch new rt-feature current
171169
fossil update rt-feature
172170
write_file a.txt "one\nTWO\nthree\nfour\n"
173171
fossil commit -m "rt-f1"
@@ -228,13 +226,11 @@
228226
fossil update trunk
229227
fossil branch new rt-bundled current
230228
fossil update rt-bundled
231229
write_file a.txt "bundled\n"
232230
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"
236232
fossil update trunk
237233
238234
fossil bundle export rt.bundle --branch rt-bundled
239235
fossil bundle import rt.bundle --publish -R clone.fossil
240236
241237
--- 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
--- test/set-manifest.test
+++ test/set-manifest.test
@@ -125,13 +125,11 @@
125125
# Add a tag and make sure it appears in manifest.tags
126126
fossil tag add manifest-7-tag-1 tip
127127
test "set-manifest-7-2" {[file_contains "manifest.tags" "^tag manifest-7-tag-1$"]}
128128
129129
# 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."
133131
test "set-manifest-7-3" {![file_contains "manifest.tags" "^tag manifest-7-tag-1$"]}
134132
135133
# Add new tag and check that it is in manifest.tags
136134
fossil tag add manifest-7-tag-2 tip
137135
test "set-manifest-7-4" {[file_contains "manifest.tags" "^tag manifest-7-tag-2$"]}
@@ -139,12 +137,10 @@
139137
140138
##### Tags manifest branch= updates
141139
142140
# Add file, create new branch on commit and check that
143141
# 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
147143
test "set-manifest-8" {[file_contains "manifest.tags" "^branch manifest-8-branch$"]}
148144
149145
150146
test_cleanup
151147
--- 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 @@
225225
# behavior as fossil revert: calmly back out both the rename and the
226226
# add, and presumably stash the content of the added file before it
227227
# is replaced by the revert.
228228
#
229229
test_setup
230
-write_file f1 "f1"
231
-fossil add f1
232
-fossil commit -m "add f1"
230
+commit_file f1 "f1" "add f1"
233231
234232
write_file f1n "f1n"
235233
fossil mv f1 f1n
236234
write_file f1 "f1b"
237235
fossil add f1
238236
--- 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 @@
3131
package require Tcl 8.6-
3232
3333
set clock_start [clock milliseconds]
3434
set testfiledir [file normalize [file dirname [info script]]]
3535
set testrundir [pwd]
36
-set testdir [file normalize [file dirname $argv0]]
3736
set fossilexe [file normalize [lindex $argv 0]]
3837
set is_windows [expr {$::tcl_platform(platform) eq "windows"}]
3938
set is_cygwin [regexp {^CYGWIN} $::tcl_platform(os)]
4039
4140
if {$::is_windows} {
@@ -63,11 +62,11 @@
6362
set argv [lreplace $argv $i $i]
6463
}
6564
}
6665
6766
if {[llength $argv]==0} {
68
- foreach f [lsort [glob $testdir/*.test]] {
67
+ foreach f [lsort [glob $testfiledir/*.test]] {
6968
set base [file root [file tail $f]]
7069
lappend argv $base
7170
}
7271
}
7372
@@ -220,10 +219,19 @@
220219
set out [open $filename w]
221220
fconfigure $out -translation binary
222221
puts -nonewline $out $txt
223222
close $out
224223
}
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
+}
225233
proc write_file_indented {filename txt} {
226234
write_file $filename [string trim [string map [list "\n " \n] $txt]]\n
227235
}
228236
229237
# Returns the directory of Fossil source files that the settings come
@@ -303,10 +311,37 @@
303311
# Returns the list of all supported settings.
304312
#
305313
proc get_all_settings {} {
306314
return [get_source_settings_in_binary 0]
307315
}
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
+}
308343
309344
# Returns the SHA1 hash of the file FILENAME, from "fossil sha1sum".
310345
#
311346
proc sha1_file {filename} {
312347
return [string range [exec $::fossilexe sha1sum $filename] 0 39]
@@ -354,16 +389,10 @@
354389
return [string match "$a*" $b]
355390
}
356391
return [string match "$b*" $a]
357392
}
358393
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
-
365394
366395
proc require_no_open_checkout {} {
367396
if {[info exists ::env(FOSSIL_TEST_DANGEROUS_IGNORE_OPEN_CHECKOUT)] && \
368397
$::env(FOSSIL_TEST_DANGEROUS_IGNORE_OPEN_CHECKOUT) eq "YES_DO_IT"} {
369398
return
@@ -1108,11 +1137,11 @@
11081137
set startPwd [pwd]
11091138
cd $tempHomePath
11101139
11111140
foreach testfile $argv {
11121141
protOut "***** $testfile ******"
1113
- if { [catch {source $testdir/$testfile.test} testerror testopts] } {
1142
+ if { [catch {source $testfiledir/$testfile.test} testerror testopts] } {
11141143
test_report test-framework-$testfile 0 "" [list "error: $testerror"]
11151144
protOut "!!!!! $testfile: $testerror"
11161145
protOutDict $testopts
11171146
# A test file that raises an error stops before its own test_cleanup,
11181147
# and the directories it leaves make the next file's test_cleanup fail.
11191148
--- 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
--- test/th1-docs.test
+++ test/th1-docs.test
@@ -39,20 +39,18 @@
3939
set env(TH1_ENABLE_DOCS) 1; # TH1 docs must be enabled for this test.
4040
set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test.
4141
4242
###############################################################################
4343
44
-set data [fossil info]
45
-
46
-regexp -line -- {^repository: (.*)$} $data dummy repository
44
+set repository [repository_path]
4745
4846
if {[string length $repository] == 0 || ![file exists $repository]} {
4947
error "unable to locate repository"
5048
}
5149
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]
5452
5553
if {![file exists $origFileStat]} {
5654
error "unable to locate [$origFileStat]"
5755
}
5856
5957
--- 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
--- test/th1-hooks.test
+++ test/th1-hooks.test
@@ -114,18 +114,17 @@
114114
}
115115
}
116116
117117
###############################################################################
118118
119
-set data [fossil info]
120
-regexp -line -- {^repository: (.*)$} $data dummy repository
119
+set repository [repository_path]
121120
122121
if {[string length $repository] == 0 || ![file exists $repository]} {
123122
error "unable to locate repository"
124123
}
125124
126
-set dataFileName [file join $::testdir th1-hooks-input.txt]
125
+set dataFileName [file join $::testfiledir th1-hooks-input.txt]
127126
128127
###############################################################################
129128
130129
set savedTh1Setup [fossil settings th1-setup]
131130
fossil settings th1-setup $testTh1Setup
132131
--- 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
--- test/unversioned.test
+++ test/unversioned.test
@@ -39,12 +39,11 @@
3939
write_file unversioned2.txt " This is unversioned file #2. "
4040
write_file "unversioned space.txt" "\nThis is unversioned file #3.\n"
4141
write_file unversioned4.txt "This is unversioned file #4."
4242
write_file unversioned5.txt "This is unversioned file #5."
4343
44
-set env(VISUAL) [appendArgs \
45
- [info nameofexecutable] " " [file join $path fake-editor.tcl]]
44
+set env(VISUAL) [fake_editor_command]
4645
4746
###############################################################################
4847
4948
# Under cygwin, the printed name with Usage: strips the extension
5049
if { $::is_cygwin && [file extension $fossilexe] eq ".exe" } {
5150
--- 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
--- test/update.test
+++ test/update.test
@@ -173,13 +173,11 @@
173173
174174
set testname "merge-renamed"
175175
set fname [test_update_setup $testname]
176176
set message "MERGE $fname -> $fname.renamed"
177177
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"
181179
write_file $fname "top\ncenter\n"
182180
fossil mv --hard $fname "$fname.renamed"
183181
fossil commit -m "Update and rename $fname"
184182
fossil up previous
185183
write_file $fname "center\nbelow\n"
@@ -187,13 +185,11 @@
187185
188186
set testname "merge-standard"
189187
set fname [test_update_setup $testname]
190188
set message "MERGE $fname"
191189
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"
195191
write_file $fname "top\ncenter\n"
196192
fossil commit -m "Update $fname"
197193
fossil up previous
198194
write_file $fname "center\nbelow\n"
199195
test_update $testname $message $changes
200196
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button