Commit Graph

4 Commits

Author SHA1 Message Date
Simon Farnsworth
44e7d4e8b5 xargs on OS X does not return 123
Summary: On Mac OS X, xargs only ever returns 1 for failure. On Linux, it returns 123 for "xargs succeeded, but the command(s) it invoked did not". Make the grep test pass on OS X.

Test Plan: Run the tests on devserver, see them pass. Try again on laptop, see them continue to pass

Reviewers: #sourcecontrol, quark

Reviewed By: quark

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D4074442

Signature: t1:4074442:1477407528:809b64f7478ff0df0d2a39b745a2b9602d5f22ee
2016-10-25 08:09:23 -07:00
Jun Wu
8a3a99ba21 hgext: move single file extensions to hgext3rd
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
2016-07-08 13:15:42 +01:00
Adam Simpkins
33cf8f401d [tweakdefaults] stop running xargs+grep through a shell
Summary:
Directly execute the xargs command, rather than using a shell.  This is
slightly more efficient, but also ensures we won't have security problems or
other issues based on the user's grep.command config setting.  Even if it
contains shell redirects, semicolons, or other special characters, we will no
longer pass them to a shell to interpret them.

We do use shlex.split() go process the grep.command setting, to allow the user
to specify a command plus arguments.

Test Plan: Included new unit tests.

Reviewers: #sourcecontrol, durham, ttung, rmcelroy

Reviewed By: rmcelroy

Subscribers: akushner, rmcelroy, sid0, net-systems-diffs@, yogeshwer, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3376617

Signature: t1:3376617:1464841542:f58fc0a05d62b649edc70bc261009875385186c9
2016-06-21 20:44:08 -07:00
Adam Simpkins
a25e35bc50 [tweakdefaults] fix handling of grep file pattern arguments
Summary:
Previously grep only searched in the current directory, even if you gave it a
pattern like "../".  This fixes the code to correctly honor the arguments, and
to accept mercurial file patterns just like most other mercurial commands.

This does change the file parsing behavior somewhat: previously "hg grep" would
treat all arguments as glob patterns.  Now you explicitly have to say
"glob:<pattern>" to get glob matching.  However, I suspect this won't impact
most users, since they would normally let their shell perform glob expansion
before the arguments are given to mercurial.

Test Plan:
Included new unit tests for grep, and updated the existing tests that were
affected by the change in glob behavior.

Reviewers: #sourcecontrol, durham, carenthomas, ttung, rmcelroy

Reviewed By: rmcelroy

Subscribers: quark, mwilliams, matthieu, meyering, yfeldblum, rmcelroy, net-systems-diffs@, yogeshwer, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3376605

Signature: t1:3376605:1464841648:98bfb47866dec802ca34f55c821796f36532211f
2016-06-21 20:44:06 -07:00