Fossil SCM

Make roundtrip.test use same hostname comparison as "fossil patch create"

danshearer 2026-11-17 13:13 UTC test-suite-new
Commit d5645b8c03a2ec72d7a126b040d2c0700e2e613883238efbd2336ae63dcf1320
1 file changed +5 -2
--- test/roundtrip.test
+++ test/roundtrip.test
@@ -255,20 +255,23 @@
255255
fossil patch create rt.patch
256256
257257
# The patch records the name of the computer it was made on. fossil
258258
# reads the name from the "hostname" program, so where that program is
259259
# missing, the name is empty and the shell's error appears on standard
260
-# error.
260
+# error. The name that the program prints can differ from Tcl's
261
+# "info hostname", for example in letter case or in its domain.
261262
#
262263
fossil sqlite3 --no-repository rt.patch \
263264
"SELECT value FROM cfg WHERE key='hostname'"
264265
if {[auto_execok hostname] eq ""} {
266
+ set hostname [info hostname]
265267
set hostnameConstraint knownBug
266268
} else {
269
+ set hostname [string trim [exec hostname]]
267270
set hostnameConstraint ""
268271
}
269
-test_eq roundtrip-patch-hostname [normalize_result] [info hostname] \
272
+test_eq roundtrip-patch-hostname [normalize_result] $hostname \
270273
$hostnameConstraint
271274
272275
fossil revert
273276
file delete new.txt
274277
fossil changes
275278
--- test/roundtrip.test
+++ test/roundtrip.test
@@ -255,20 +255,23 @@
255 fossil patch create rt.patch
256
257 # The patch records the name of the computer it was made on. fossil
258 # reads the name from the "hostname" program, so where that program is
259 # missing, the name is empty and the shell's error appears on standard
260 # error.
 
261 #
262 fossil sqlite3 --no-repository rt.patch \
263 "SELECT value FROM cfg WHERE key='hostname'"
264 if {[auto_execok hostname] eq ""} {
 
265 set hostnameConstraint knownBug
266 } else {
 
267 set hostnameConstraint ""
268 }
269 test_eq roundtrip-patch-hostname [normalize_result] [info hostname] \
270 $hostnameConstraint
271
272 fossil revert
273 file delete new.txt
274 fossil changes
275
--- test/roundtrip.test
+++ test/roundtrip.test
@@ -255,20 +255,23 @@
255 fossil patch create rt.patch
256
257 # The patch records the name of the computer it was made on. fossil
258 # reads the name from the "hostname" program, so where that program is
259 # missing, the name is empty and the shell's error appears on standard
260 # error. The name that the program prints can differ from Tcl's
261 # "info hostname", for example in letter case or in its domain.
262 #
263 fossil sqlite3 --no-repository rt.patch \
264 "SELECT value FROM cfg WHERE key='hostname'"
265 if {[auto_execok hostname] eq ""} {
266 set hostname [info hostname]
267 set hostnameConstraint knownBug
268 } else {
269 set hostname [string trim [exec hostname]]
270 set hostnameConstraint ""
271 }
272 test_eq roundtrip-patch-hostname [normalize_result] $hostname \
273 $hostnameConstraint
274
275 fossil revert
276 file delete new.txt
277 fossil changes
278

Keyboard Shortcuts

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