Fossil SCM
Make roundtrip.test use same hostname comparison as "fossil patch create"
Commit
d5645b8c03a2ec72d7a126b040d2c0700e2e613883238efbd2336ae63dcf1320
Parent
e83517252d38d40…
1 file changed
+5
-2
+5
-2
| --- test/roundtrip.test | ||
| +++ test/roundtrip.test | ||
| @@ -255,20 +255,23 @@ | ||
| 255 | 255 | fossil patch create rt.patch |
| 256 | 256 | |
| 257 | 257 | # The patch records the name of the computer it was made on. fossil |
| 258 | 258 | # reads the name from the "hostname" program, so where that program is |
| 259 | 259 | # 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. | |
| 261 | 262 | # |
| 262 | 263 | fossil sqlite3 --no-repository rt.patch \ |
| 263 | 264 | "SELECT value FROM cfg WHERE key='hostname'" |
| 264 | 265 | if {[auto_execok hostname] eq ""} { |
| 266 | + set hostname [info hostname] | |
| 265 | 267 | set hostnameConstraint knownBug |
| 266 | 268 | } else { |
| 269 | + set hostname [string trim [exec hostname]] | |
| 267 | 270 | set hostnameConstraint "" |
| 268 | 271 | } |
| 269 | -test_eq roundtrip-patch-hostname [normalize_result] [info hostname] \ | |
| 272 | +test_eq roundtrip-patch-hostname [normalize_result] $hostname \ | |
| 270 | 273 | $hostnameConstraint |
| 271 | 274 | |
| 272 | 275 | fossil revert |
| 273 | 276 | file delete new.txt |
| 274 | 277 | fossil changes |
| 275 | 278 |
| --- 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 |