<div dir="ltr">I am banned from tracker, so I post the bug here:<div><br></div><div>Normal Windows behavior:</div><div><br></div><div>  >hg status --rev ".^1"</div><div>  M mercurial\commands.py<br></div><div>

  ? pysptest.py<br></div><div><br></div><div>  >hg status --rev .^1</div><div>  abort: unknown revision '.1'!<br></div><div><br></div><div>So, ^ is an escape character. See <a href="http://www.tomshardware.co.uk/forum/35565-45-when-special-command-line">http://www.tomshardware.co.uk/forum/35565-45-when-special-command-line</a></div>

<div><br></div><div><br></div><div>But subprocess doesn't escape it, making cross-platform command fail on Windows.</div><div><br></div><div>---[cut pysptest.py]--</div><div><div>import subprocess as sp</div><div><br>

</div><div># this fails with</div><div># abort: unknown revision '.1'!</div><div>cmd = ['hg', 'status', '--rev', '.^1']</div><div># this works</div><div>#cmd = 'hg status --rev ".^1"'</div>

<div># this works too</div><div>#cmd = ['hg', 'status', '--rev', '.^^1']</div><div><br></div><div>try:</div><div>  print sp.check_output(cmd, stderr=sp.STDOUT, shell=True)</div><div>except Exception as e:</div>

<div>  print e.output</div><div>------------------------------</div><div><br></div>-- <br>anatoly t.
</div></div>