Summary:
This diff makes the code closer to shell behavior.
For example, globs are disabled for both single and double quotes:
~ % echo /bin/bash*
/bin/bash /bin/bashbug
~ % echo "/bin/bash*"
/bin/bash*
~ % echo '/bin/bash*'
/bin/bash*
Environment variables are not expanded for single qutoes:
~ % echo $PWD
/home/quark
~ % echo "$PWD"
/home/quark
~ % echo '$PWD'
$PWD
Tests using single quoted environment varialbes are updated to use double
quotes, mostly by using this vim command:
%s/\(sh % ".*\)'\([^'$]*\$[^']*\)'/\1\\"\2\\"
The translation script was updated to prefer double quotes to preserve
environment variable expansion behavior.
Reviewed By: xavierd
Differential Revision: D17675351
fbshipit-source-id: d5c8d5f23ea8e29fe093c4e6ae89ddacda97141e
Summary:
The `Dispatcher` provides lots of features but its internal state only contains
the command table. Replace it with `CommandTable` and make the methods free
functions.
This makes function dependencies more cleaner, for example things like "locating
a repo", "getting the args" etc. won't require a `Dispatcher`.
A side effect of this change is the non-utf8 command line arguments are no longer
supported. This is already broken since our hg wrapper (accidentally) enforced
utf-8 command line. Therefore related tests are removed.
Reviewed By: sfilipco
Differential Revision: D16796395
fbshipit-source-id: a793ce7b8befe7caf62405c582fc932eb3daa099
Summary: Fix various Windows compatibility issues in the test.
Reviewed By: sfilipco
Differential Revision: D16501049
fbshipit-source-id: 72de26fc80a5f9e023e4b30cc2111810c7ff4626
Summary:
Manually fix the test so it runs. This is done by removing incompatible
features (cmp, diff), and rewritting bash for loops to Python loops.
It took 183s before, and 6.6s now.
Reviewed By: xavierd
Differential Revision: D16435711
fbshipit-source-id: abf8889caa8b9b7b4137c873f3926ce1c6792f55
Summary:
This is done via:
python -m testutil.dott.translate --black --verify test-command-template.t
hg mv --after test-command-template.t test-command-template-t.py
The test is currently broken, though. It will be fixed in the next diff.
Reviewed By: xavierd
Differential Revision: D16450199
fbshipit-source-id: 73f80fd616e34c402016ff82a37eb68651a75b6e