Commit Graph

9 Commits

Author SHA1 Message Date
Jun Wu
cff15c8654 fbshow: do not pass non-string config name to ui.setconfig
Summary:
The old code is passing tuples like `("B", "ignore-blank-lines", None, _("ignore changes whose lines are all blank"))`
as config name to `ui.setconfig`, which is clearly wrong.

Also, the CLI flag does not match configs in the `[diff]` config section, ex.
`diff.ignore-blank-lines` is not the config option. `diff.ignoreblanklines` is.
`diff.ignore-all-space` is not the config option. `diff.ignorews` is.

The diffopts config overrides are not necessary since the options are passed to
the diff command any way. So just drop it.

Reviewed By: DurhamG

Differential Revision: D8945812

fbshipit-source-id: 97eb2b1020c7ed8036a06a74f1bbb39bb545721b
2018-08-09 21:21:51 -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
Stanislau Hlebik
87a6499b5f add getcmdanddefaultopts
Summary:
Add a function that returns command and all the default options already
initialized. It should be used by commands that call other commands. For
example, calling pull inside of update, calling log inside of show etc.
getcmdanddefaultopts has important benefits:
1) It returns "wrapped" command i.e. command with all the overrides applied. On
the other hand, commands.pull doesn't return it.
2) It correctly initializes options to their default value and correctly
changes their name - replace '-'  with '_'.

Reviewed By: ryanmce

Differential Revision: D7193296

fbshipit-source-id: e8673bd4e16aad6156498660f2a7ed788ed2cac3
2018-04-13 21:51:24 -07:00
Stanislau Hlebik
a7bb5defb2 add --noprefix and --nodates option to show
Differential Revision: D7067556

fbshipit-source-id: 38aa09a544a1422e8762a7ebd697e55210ad20c5
2018-04-13 21:51:15 -07:00
Stanislau Hlebik
5b58008d6d mercurial hack-a-day: fix hg show REV FILE hanging
Summary:
`hg show REV FILE` would hang indefinitely, while `hg log -p FILE -r REV` works
fine. The reason is that fbshow extensions calls log command from commands.py
directly. But remotefilelog extension wraps log command and adds special
options to make it faster.

Let's call the wrapped version of log command

Differential Revision: D7066869

fbshipit-source-id: 3bda4b3b1a1fe9503eb05355816b28ba924048ff
2018-04-13 21:51:15 -07:00
Jun Wu
2946a1c198 codemod: use single blank line
Summary: This makes test-check-code cleaner.

Reviewed By: ryanmce

Differential Revision: D6937934

fbshipit-source-id: 8f92bc32f75b9792ac67db77bb3a8756b37fa941
2018-04-13 21:51:08 -07:00
Dmitry Zhuk
df266f86b7 fbshow: add whitespace handling to hg show
Summary:
Added options supported by diff:
```
-w --ignore-all-space    ignore white space when comparing lines
-b --ignore-space-change ignore changes in the amount of white space
-B --ignore-blank-lines  ignore changes whose lines are all blank
-Z --ignore-space-at-eol ignore changes in whitespace at EOL
```

Differential Revision: D6738122

fbshipit-source-id: bd4236ce7cb9d5f803f932cfec267de71b0067c2
2018-04-13 21:50:53 -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