Skip to content

Commit e3218ff

Browse files
committed
tools: use a .hg/hgrc file for install_version_test.v (workaround windows failure)
1 parent 73b5423 commit e3218ff

1 file changed

Lines changed: 18 additions & 5 deletions

File tree

‎cmd/tools/vpm/install_version_test.v‎

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ fn test_install_from_hg_url_with_version_tag() ! {
107107
return
108108
}
109109

110-
hg_version := cmd_ok(@LOCATION, 'hg version')
111-
dump(hg_version)
110+
hg_version := cmd_ok(@LOCATION, 'hg version -q')
111+
dump(hg_version.output.trim_space())
112112

113113
test_module_path := os.join_path(os.temp_dir(), rand.ulid(), 'hg_test_module')
114114
defer {
@@ -117,23 +117,36 @@ fn test_install_from_hg_url_with_version_tag() ! {
117117
mut res := cmd_ok(@LOCATION, 'hg init ${test_module_path}')
118118
os.chdir(test_module_path)!
119119

120+
println('> writing .hg/hgrc to the new mercurial repo ...')
121+
os.mkdir_all('.hg')!
122+
os.write_file('.hg/hgrc', '[ui]\nusername = v_ci <v_ci@example.net>\nverbose = False\n')!
123+
println('> writing .hg/hgrc done.')
124+
125+
println('> writing v.mod file ...')
120126
os.write_file('v.mod', "Module{
121127
name: 'my_awesome_v_module'
122128
version: '0.1.0'
123129
}")!
130+
println('> writing v.mod file done.')
131+
124132
cmd_ok(@LOCATION, 'hg add')
125-
cmd_ok(@LOCATION, 'hg --config ui.username=v_ci commit -m "initial commit"')
133+
cmd_ok(@LOCATION, 'hg commit -m "initial commit"')
134+
println('> writing README.md file ...')
126135
os.write_file('README.md', 'Hello World!')!
136+
println('> writing README.md file done.')
127137
cmd_ok(@LOCATION, 'hg add')
128-
cmd_ok(@LOCATION, 'hg --config ui.username=v_ci commit -m "add readme"')
138+
cmd_ok(@LOCATION, 'hg commit -m "add readme"')
129139
cmd_ok(@LOCATION, 'hg tag v0.1.0')
130140

141+
println('> rewriting v.mod ...')
131142
os.write_file('v.mod', "Module{
132143
name: 'my_awesome_v_module'
133144
version: '0.2.0'
134145
}")!
146+
println('> rewriting v.mod done.')
147+
135148
cmd_ok(@LOCATION, 'hg add')
136-
cmd_ok(@LOCATION, 'hg --config ui.username=v_ci commit -m "bump version to v0.2.0"')
149+
cmd_ok(@LOCATION, 'hg commit -m "bump version to v0.2.0"')
137150

138151
mut p, port := test_utils.hg_serve(hg_path, test_module_path)
139152
res = os.execute('${vexe} install -v --hg http://127.0.0.1:${port}@v0.1.0')

0 commit comments

Comments
 (0)