Commit Graph

62 Commits

Author SHA1 Message Date
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
Mark Thomas
6e2d83c5ca purge: use fsmonitor to speed up hg purge
Summary:
`hg purge --dirs` is slow because it asks for all the directories in the repo,
which disables the fsmonitor speed improvements to dirstate.walk.

To make purge faster, separately query watchman for all the dirs in the repo
(it can answer this fairly quickly).

Reviewed By: mjpieters

Differential Revision: D7067811

fbshipit-source-id: 18e76c685bd630862d12e7e59c2817a8f45ed073
2018-04-13 21:51:16 -07:00
Yuya Nishihara
6c2103bc71 commands: move templates of common command options to cmdutil (API)
The goal is to get rid of the debugcommands -> commands dependency.

Since globalopts is the property of the commands, it's kept in the commands
module.
2017-05-14 16:19:47 +09:00
Yuya Nishihara
3e663dde68 registrar: move cmdutil.command to registrar module (API)
cmdutil.command wasn't a member of the registrar framework only for a
historical reason. Let's make that happen. This patch keeps cmdutil.command
as an alias for extension compatibility.
2016-01-09 23:07:20 +09:00
Augie Fackler
4e1c384d0a extensions: change magic "shipped with hg" string
I've caught multiple extensions in the wild lying about being
'internal', so it's time to move the goalposts on people. Goalpost
moving will continue until third party extensions stop trying to
defeat the system.
2016-08-23 11:26:08 -04:00
Gregory Szorc
1ddd445f21 purge: use opts.get()
Most commands use opts.get() to retrieve values for options
that may not be explicitly passed. purge wasn't.

This makes it easier to call purge() from 3rd party extensions.
2016-05-16 14:21:39 -07:00
Yuya Nishihara
a5c934df3c py3: move up symbol imports to enforce import-checker rules
Since (b) is banned, we should do the same for (a) for consistency.

 a) from mercurial import hg
    from mercurial.i18n import _

 b) from . import hg
    from .i18n import _
2016-05-14 14:03:12 +09:00
timeless
8f60984480 purge: use absolute_import 2016-03-02 21:39:55 +00:00
Pierre-Yves David
30913031d4 error: get Abort from 'error' instead of 'util'
The home of 'Abort' is 'error' not 'util' however, a lot of code seems to be
confused about that and gives all the credit to 'util' instead of the
hardworking 'error'. In a spirit of equity, we break the cycle of injustice and
give back to 'error' the respect it deserves. And screw that 'util' poser.

For great justice.
2015-10-08 12:55:45 -07:00
Matt Mackall
5e1b4ad958 urls: bulk-change primary website URLs 2015-09-30 15:43:49 -05:00
Augie Fackler
f95a6caba1 extensions: document that testedwith = 'internal' is special
Extension authors (notably at companies using hg) have been
cargo-culting the `testedwith = 'internal'` bit from hg's own
extensions, which then defeats our "file bugs over here" logic in
dispatch. Let's be more aggressive about trying to give extension
authors a hint about what testedwith should say.
2015-04-28 16:44:37 -04:00
Martin von Zweigbergk
cb32fc3c29 purge: access status fields by name rather than index 2014-10-03 10:38:43 -07:00
Siddharth Agarwal
cbca8f558d purge: avoid full walks when directories aren't purged
If match.traversedir is not None, we're forced to do full walks. However when
we aren't purging directories we don't need to set match.traversedir to
anything.

This speeds up non-full walks such as the one hgwatchman makes possible. For
mozilla-central with hgwatchman enabled, 'hg purge --files' goes from 0.88
seconds to 0.22.
2014-08-20 15:07:25 -07:00
Matt Mackall
b8ee937b8c purge: drop stat import 2014-08-04 15:24:57 -05:00
Christian Ebert
dd01594f6d purge: prefer util.unlink instead over own removefile 2014-08-02 09:45:21 +01:00
Ben Kehoe
3b4d556fee purge: add options for deleting only files or only directories 2013-11-07 17:24:14 -08:00
anuraggoel
08543b09f1 purge: avoid duplicate output for --print (issue4092)
Now "hg purge -p" commands avoids printiing duplication of filenames.

Second patch is the test coverage of first patch which tells that '-p'
does not depend on whether ui.verbose is configured or not,that means it
is independent of '-v'.
2014-02-25 06:30:21 +05:30
Siddharth Agarwal
45c34a6c9f purge: hook into match.explicitdir and traversedir 2013-04-28 21:27:57 -07:00
Martin Geisler
a987a9f256 purge: lowercase messages 2012-06-12 14:18:18 +02:00
Augie Fackler
96d44b39f7 hgext: mark all first-party extensions as such 2012-05-15 14:37:49 -05:00
Martin Geisler
d8334151e6 Remove FSF mailing address from GPL headers
The GPLv3 FAQ suggests to upgrade by

  [...] replace all your existing v2 license notices (usually at the
  top of each file) with the new recommended text available on the GNU
  licenses howto. It's more future-proof because it no longer includes
  the FSF's postal mailing address.

This removes the postal address, but leaves the version number at 2+.
2012-01-06 16:27:13 +01:00
Matt Mackall
5ab97592f7 scmutil: switch match users to supplying contexts
The most appropriate context is not always clearly defined. The obvious cases:

For working directory commands, we use None
For commands (eg annotate) with single revs, we use that revision

The less obvious cases:

For commands (eg status, diff) with a pair of revs, we use the second revision
For commands that take a range (like log), we use None
2011-06-18 16:52:51 -05:00
Matt Mackall
0832007f60 scmutil: drop aliases in cmdutil for match functions 2011-05-13 14:58:24 -05:00
Adrian Buehlmann
31d8f478f5 purge: use cmdutil.command decorator 2011-05-12 20:14:42 +02:00
Martin Geisler
f1853c5e82 Use hg role in help strings 2010-04-22 10:24:49 +02:00
Martin Geisler
fc39ad4866 purge: wrap docstrings at 70 characters 2009-07-26 01:59:28 +02:00
Martin Geisler
91129d0f60 purge: fix formatting of lists with proper reST markup 2009-07-23 00:25:34 +02:00
Martin Geisler
491bee86aa purge: wrapped docstrings at 78 characters 2009-07-07 23:54:42 +02:00
Dirkjan Ochtman
1d29e68744 change wiki/bts URLs to point to new hostname 2009-06-24 15:32:37 +02:00
Dirkjan Ochtman
0448417ea2 extensions: change descriptions for extensions providing a few commands 2009-06-24 13:42:02 +02:00
Cédric Duval
dbcec5595d extensions: improve the consistency of synopses
Trying as much as possible to consistently:
 - use a present tense predicate followed by a direct object
 - verb referring directly to the functionality provided
   (ie. not "add command that does this" but simple "do that")
 - keep simple and to the point, leaving details for the long help
   (width is tight, possibly even more so for translations)

Thanks to timeless, Martin Geisler, Rafael Villar Burke, Dan Villiom
Podlaski Christiansen and others for the helpful suggestions.
2009-06-22 15:48:08 +02:00
Dirkjan Ochtman
a774ff01bc help: add/fix docstrings for a bunch of extensions 2009-06-21 16:45:47 +02:00
Cédric Duval
0caffe860f help: remove per-extension paragraph on how to enable it
The central place to find this information is the "extensions" help topic.
2009-06-20 20:57:13 +02:00
timeless
fb33de67af Generally replace "file name" with "filename" in help and comments. 2009-06-09 09:25:17 -04:00
Cédric Duval
8ab8d67bca purge: fix spelling error 2009-05-24 22:17:12 +02:00
Matt Mackall
2f9b02c62d replace util.sort with sorted built-in
This is marginally faster for small and moderately-sized lists
2009-04-26 16:50:44 -05:00
Martin Geisler
52ce98c9a8 help texts: write command line switches as -a/--abc 2009-04-18 14:40:21 +02:00
Patrick Mezard
629f02e472 purge: fix 7625ece8e2f7 (remove read-only files)
- use try/except to avoid unnecessary work
- edit only mode bits
2009-04-11 00:13:18 +02:00
Patrick Mezard
229740c001 purge: remove read-only files under Windows (issue583)
Initial version by Benoit Boissinot <bboissin@gmail.com>
2009-04-10 21:20:28 +02:00
Martin Geisler
231b907d02 purge: word-wrap help texts at 70 characters 2009-04-04 23:18:51 +02:00
Benjamin Pollack
3d7cb92dd9 1 file changed, 7 insertions(+), 9 deletions(-)
hgext/purge.py |   16 +++++++---------


purge: clarify behavior with regard to ignored files

The purge documentation previously said that purge would delete ignored
files.  This is only true if purge is passed the --all option, which is
now stated explicitly.  A few trivial grammar errors were also fixed.
2009-01-05 12:48:20 -05:00
Martin Geisler
336bd98e22 use repo.wjoin(f) instead of os.path.join(repo.root, f) 2009-01-02 22:53:33 +01:00
Benoit Boissinot
ea7fe6dacc remove unused variables 2008-10-28 19:25:26 +01:00
Matt Mackall
a65ef7bc5d util: add sort helper 2008-06-27 18:28:45 -05:00
Matt Mackall
8e1dce7068 purge: cleanup
- remove casefolding check, no longer needed
- fold error function into remove
- simplify eol logic
- remove force logic and parameters
2008-06-26 18:44:54 -05:00
Matt Mackall
89dadf7a3b purge: use status 2008-06-26 14:35:50 -05:00
Matt Mackall
b2155285a8 rename checkfolding to checkcase 2008-06-26 13:58:24 -05:00
Matt Mackall
fb88571d19 match: remove files arg from repo.status and friends 2008-05-12 11:37:08 -05:00
Matt Mackall
a4bb4bf5d0 purge: remove unused 'missing' logic 2008-05-12 11:37:08 -05:00
Matt Mackall
b4d6b6c45b walk: use match.dir in statwalk 2008-05-12 11:37:08 -05:00