This solves check-code issues:
fastmanifest/concurrency.py:144:
> if platform.system() == 'Windows':
don't use platform.system(), use pycompat
hgext3rd/extutil.py:15:
> if platform.system() == 'Windows':
don't use platform.system(), use pycompat
remotefilelog/basepack.py:44:
> if pycompat.osname == 'posix':
use pycompat.isposix
D319 renamed `peer.pipe[ioe]` to `peer._pipe[ioe]`.
D320 removed `peer.batch`.
D331 renamed `subprocess` to `_subprocess`.
D336 renamed `_capabilities` to `capabilities`.
Let's be compatible with those changes.
Differential Revision: https://phab.mercurial-scm.org/D425
Summary:
Add some basic unit tests for extutil.runbgcommand().
This also changes the behavior to throw an OSError if we fail to execute the
process, instead of a subprocess.CalledProcessError. This matches the behavior
of the subprocess module when it fails to execute the command.
Test Plan: Ran the tests.
Reviewers: stash, quark
Reviewed By: quark
Subscribers: net-systems-diffs@fb.com, yogeshwer, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4864999
Signature: t1:4864999:1491874918:c03edafe02af217e41c28a770137bfd72bcbba9b
Summary:
Add a new `runbgcommand()` function, which is similar to `runshellcommand()`
but does not require running the command through a subshell. Running commands
through a shell is a very common place for security vulnerabilities if care is
not taken to correctly escape all arguments.
This changes `runshellcommand()` to be implemented using `runbgcommand()`.
This does change the behavior of `runshellcommand()` slightly:
`runshellcommand()` now throws an exception if it failed to execute the
command. Previously the Unix implementation silently swallowed most
exceptions. This also fixes the unix implementation to properly wait on the
intermediate child process. Previously it would remain as a zombie process.
Test Plan: Ran all unit tests.
Reviewers: #mercurial, stash
Reviewed By: stash
Subscribers: quark, net-systems-diffs@fb.com, yogeshwer, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4856672
Signature: t1:4856672:1491813879:367e1f42b9aa7797542f0d02da99f46683b80df8
Summary:
I'm going to use runshellfast in infinitepush.
To avoid copy-paste let's move it to the separate package.
Note: fastmanifest also has runshellfast but it's implementation
is a bit different and seems that it doesn't work with remotefilelog.
So I'll leave it alone for now.
Test Plan: python run-tests.py -j20
Reviewers: #sourcecontrol
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4175836
Summary:
Be a better citizen under system python path.
Fix all tests issues and change setup.py to use glob pattern to include
all extensions.
Test Plan:
Run tests and `make local`.
Also build and install the package and run `hg sl` in major repos.
Reviewers: #mercurial, ttung, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, durham, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3534311
Signature: t1:3534311:1468275426:fe122646c8bd6c541e1889e73e9df28f86747ff2