comparison mercurial/util.py @ 13188:6c9345f9edca stable

util: concentrate quoting knowledge to windows.py quotecommand() This fixes all callers of util.quotecommand() and place special knowledge of the bugfix in 2.7.1 in a single platform specific place.
author Steve Borho <steve@borho.org>
date Wed, 22 Dec 2010 13:25:00 -0600
parents dbc546811dd6
children f5be619663f9 5b83ab614dab
comparison
equal deleted inserted replaced
13183:f9d29777b4eb 13188:6c9345f9edca
389 return '0' 389 return '0'
390 if val is True: 390 if val is True:
391 return '1' 391 return '1'
392 return str(val) 392 return str(val)
393 origcmd = cmd 393 origcmd = cmd
394 if os.name == 'nt' and sys.version_info < (2, 7, 1): 394 cmd = quotecommand(cmd)
395 # Python versions since 2.7.1 do this extra quoting themselves
396 cmd = '"%s"' % cmd
397 env = dict(os.environ) 395 env = dict(os.environ)
398 env.update((k, py2shell(v)) for k, v in environ.iteritems()) 396 env.update((k, py2shell(v)) for k, v in environ.iteritems())
399 env['HG'] = hgexecutable() 397 env['HG'] = hgexecutable()
400 if out is None: 398 if out is None:
401 rc = subprocess.call(cmd, shell=True, close_fds=closefds, 399 rc = subprocess.call(cmd, shell=True, close_fds=closefds,