# HG changeset patch # User Simon Heimberg # Date 2014-02-08 09:41:17 # Node ID a8e6ab7eb361411313508d4ffdb9fc24fcef40d9 # Parent ab71fb058ebf6e831a3cee2e078e015b9e1e40c6 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. diff --git a/tests/test-commandserver.py b/tests/test-commandserver.py --- a/tests/test-commandserver.py +++ b/tests/test-commandserver.py @@ -267,7 +267,10 @@ def obsolete(server): runcommand(server, ['up', 'null']) runcommand(server, ['phase', '-df', 'tip']) - os.system('hg debugobsolete `hg log -r tip --template {node}`') + cmd = 'hg debugobsolete `hg log -r tip --template {node}`' + if os.name == 'nt': + cmd = 'sh -c "%s"' % cmd # run in sh, not cmd.exe + os.system(cmd) runcommand(server, ['log', '--hidden']) runcommand(server, ['log'])