Commit Graph

10 Commits

Author SHA1 Message Date
Wez Furlong
aada6d062b gracefully handle unexpected output from biggrep
Summary:
We didn't expect output like `Binary file some/path/to/file matches`, so we'd emit an ugly stack trace.

This diff checks for that case specifically, and also adds a reasonable fallback: any lines that fail to parse
are simply passed through.

Reviewed By: quark-zju

Differential Revision: D9351302

fbshipit-source-id: 412a4c21a7c941d24a0d26d9c89cdf62a42c52f1
2018-08-15 16:36:12 -07:00
Wez Furlong
70cdd4a413 make hg grep aware of big grep
Summary:
This isn't 100% finished and is missing handling some
error cases, but I wanted to put it out there to get some knee-jerk
reactions and suggestions on how to handle some things.

This diff adds a `grep.usebiggrep` config option to `hg grep`.  The idea is
that we'll default this to on when the repo requires `eden` (or when we pull in
the eden specific site configuration).  When run in big-grep mode, we'll first
ask big grep for the results and then compute the local differences and run
only those through the local grep process, and avoid materializing files
locally.

I'm not 100% sure if the current `repo.status` call will yield the correct
results for the case where the current rev is behind the biggrep
corpus revision.

Reviewed By: quark-zju

Differential Revision: D8416360

fbshipit-source-id: 952badb7a7ec74096b5c77cd79aa25e2327a7659
2018-07-06 20:14:28 -07:00
Jun Wu
47b327c175 rebase: use command-level template (BC)
Summary:
Use the command-level template and the `nodechanges` template keyword.
Drop the use of formatter.

`-Tjson` is not treated specially so it will just print `json`. If we'd like
to make it output `{"nodehcnages": ...}` (probably not a list with one
element), it's doable by having some mapping from `json` to a default
template.

Reviewed By: mitrandir77

Differential Revision: D8221076

fbshipit-source-id: 75575a98324d0d069789e0e915d5aa282ca0d4bb
2018-06-06 15:43:25 -07:00
Lukasz Langa
dfda82e492 Upgrade to 18.5b1
Summary: Mostly empty lines removed and added.  A few bugfixes on excessive line splitting.

Reviewed By: quark-zju

Differential Revision: D8199128

fbshipit-source-id: 90c1616061bfd7cfbba0b75f03f89683340374d5
2018-05-30 02:23:58 -07:00
Jun Wu
584656dff3 codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).

Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.

Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.

An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.

As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.

Reviewed By: wez, phillco, simpkins, pkaush, singhsrb

Differential Revision: D8173629

fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-25 22:17:29 -07:00
Jun Wu
6596190811 tweakdefaults: avoid crash with "rebase -r foo -d func(SRC)"
Summary:
The destination revset could contain `SRC` that will break tweakdefaults.
Change the ordering so it could work.

Reviewed By: singhsrb

Differential Revision: D7924127

fbshipit-source-id: cb3eb1379425303607e4cb6f57f534133d457dea
2018-05-09 00:26:47 -07:00
Jun Wu
18c17ec9f1 tweakdefaults: use hint framework for prev
Summary:
A side effect is, the hint won't be printed out if fbamend is not enabled,
which is more "correct".

Reviewed By: markbt

Differential Revision: D7392130

fbshipit-source-id: 5b7aa4cc3083b03546c54965ce51040fab958b87
2018-04-13 21:51:49 -07:00
Phil Cohen
45c4a072f9 hgext: use relative imports wherever possible
Summary:
Port of D6798134 to fbsource. It eliminates module-import failures as well as errors like this:

```
mercurial.error.ForeignImportError: hgext.extlib.treedirstate: /home/phillco/.local/lib/python2.7/site-packages/hgext/extlib/treedirstate.so lives outside /..../hg
```

....that block other tests, like test-help.t

(Note: this ignores all push blocking failures!)

Reviewed By: quark-zju

Differential Revision: D6799259

fbshipit-source-id: b77d1b565dbf52165e0847002be498648658e064
2018-04-13 21:50:56 -07:00
Kostia Balytskyi
0e4d95b67e fb-hgext: fix gendoc-related issues
Summary:
These fixes are related to documentation-related check-style tests.

Depends on D6675344

Test Plan: - more tests pass

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6675351
2018-01-09 03:44:33 -08:00
Kostia Balytskyi
e75b9fc1b1 fb-hgext: move most of hgext3rd and related tests to core
Summary:
This commit moves most of the stuff in hgext3rd and related tests to
hg-crew/hgext and hg-crew/test respectively.

The things that are not moved are the ones which require some more complex
imports.


Depends on D6675309

Test Plan: - tests are failing at this commit, fixes are in the following commits

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6675329
2018-01-09 03:03:59 -08:00