Mercurial > hg
comparison tests/test-commandserver.py @ 20396:a8e6ab7eb361
tests: on windows, run command explicitly in sh for working command substitution
On windows, os.system runs the command in cmd.exe, which does not know command
substitution. To let this work, run the command explicitly in sh.
This fixes the failure of this test on windows.
author | Simon Heimberg <simohe@besonet.ch> |
---|---|
date | Sat, 08 Feb 2014 10:41:17 +0100 |
parents | 69a0d22b9677 |
children | e3d1df48fcc6 |
comparison
equal
deleted
inserted
replaced
20395:ab71fb058ebf | 20396:a8e6ab7eb361 |
---|---|
265 def obsolete(server): | 265 def obsolete(server): |
266 readchannel(server) | 266 readchannel(server) |
267 | 267 |
268 runcommand(server, ['up', 'null']) | 268 runcommand(server, ['up', 'null']) |
269 runcommand(server, ['phase', '-df', 'tip']) | 269 runcommand(server, ['phase', '-df', 'tip']) |
270 os.system('hg debugobsolete `hg log -r tip --template {node}`') | 270 cmd = 'hg debugobsolete `hg log -r tip --template {node}`' |
271 if os.name == 'nt': | |
272 cmd = 'sh -c "%s"' % cmd # run in sh, not cmd.exe | |
273 os.system(cmd) | |
271 runcommand(server, ['log', '--hidden']) | 274 runcommand(server, ['log', '--hidden']) |
272 runcommand(server, ['log']) | 275 runcommand(server, ['log']) |
273 | 276 |
274 if __name__ == '__main__': | 277 if __name__ == '__main__': |
275 os.system('hg init') | 278 os.system('hg init') |