- Nov 27, 2020
-
-
durin42 authored
This required a couple of small tweaks to un-confuse black, but now it works. Big formatting changes come from: * Dramatically improved collection-splitting logic upstream * Black having a strong (correct IMO) opinion that """ is better than ''' Differential Revision: https://phab.mercurial-scm.org/D9430
-
- Nov 06, 2020
-
-
Gregory Szorc authored
Python 3 is the future. We want Python scripts to be using Python 3 by default. This change updates all `#!/usr/bin/env python` shebangs to use `python3`. Does this mean all scripts use or require Python 3: no. In the test environment, the `PATH` environment variable in tests is updated to guarantee that the Python executable used to run run-tests.py is used. Since test scripts all now use `#!/usr/bin/env python3`, we had to update this code to install a `python3` symlink instead of `python`. It is possible there are some random scripts now executed with the incorrect Python interpreter in some contexts. However, I would argue that this was a pre-existing bug: we should almost always be executing new Python processes using the `sys.executable` from the originating Python script, as `python` or `python3` won't guarantee we'll use the same interpreter. Differential Revision: https://phab.mercurial-scm.org/D9273
-
- Oct 29, 2020
-
-
Dan Villiom Podlaski Christiansen authored
`itervalues()` is only available on Python 2. Since this script doesn't currently refer to the main Mercurial modules, and as a result doesn't have easy access to the `pycompat` module, I simply changed it to use `value()` instead. Although this allocates a list on Python 2, I'd consider that acceptable for a utility script; Mercurial doesn't have all _that_ many commands anyway. Differential Revision: https://phab.mercurial-scm.org/D9259
-
- Mar 06, 2020
-
-
Augie Fackler authored
Built with: hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**" - hgext/fsmonitor/pywatchman/**' | xargs pyupgrade --keep-percent-format --keep-extraneous-parens and then blackened. pyupgrade comes from https://github.com/asottile/pyupgrade with a patch to let me preserve extraneous parens (which we use for marking strings that shouldn't be translated), and lets us clean up a bunch of idioms that have cruftily accumulated over the years. # skip-blame no-op automated code cleanups Differential Revision: https://phab.mercurial-scm.org/D8255
-
- Dec 27, 2019
-
-
Matt Harbison authored
Caught by PyCharm. Differential Revision: https://phab.mercurial-scm.org/D7745
-
- Nov 16, 2019
-
-
Gregory Szorc authored
These scripts weren't blackened. I found these as part of adding script checking to test-check-format.t. # skip-blame black Differential Revision: https://phab.mercurial-scm.org/D7446
-
- Oct 06, 2019
-
-
Augie Fackler authored
This is using my patch to black (https://github.com/psf/black/pull/826) so we don't un-wrap collection literals. Done with: hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**"' | xargs black -S # skip-blame mass-reformatting only # no-check-commit reformats foo_bar functions Differential Revision: https://phab.mercurial-scm.org/D6971
-
- Feb 21, 2019
-
-
Augie Fackler authored
This is a little less brittle, and often helps indentation. In a surprising number of cases the entire cleanup was deleting the \, as the expression was *already* parenthesized in a workable way. Differential Revision: https://phab.mercurial-scm.org/D5993
-
- Oct 12, 2018
-
-
Augie Fackler authored
# no-check-commit third-party code that doesn't match our style Differential Revision: https://phab.mercurial-scm.org/D5001
-
- Aug 22, 2018
-
-
Katsunori FUJIWARA authored
Before this patch, i18n comments of translatable texts are lost at creation of hg.pot file, if: - same translatable text appears multiple times, - the 1st appearance does not have i18n comment, and - any of rest has it For example, previous patch for filemerge.py adds translatable texts with i18n comments, but these comments are lost, because: - automatically added texts in docstring of internal merge tools are picked up earlier than these translatable texts, because of location in filemerge.py - but docstring has no i18n comment This patch makes addentry() of posplit merge i18n comments of later translatable texts, in order to keep them at creation of hg.pot.
-
- Jun 11, 2018
-
-
Katsunori FUJIWARA authored
Now, hggettext specific warning messages are formatted in: FILENAME:LINENO:MESSAGE This allows editors to jump into corresponded line easily.
-
- Jun 06, 2018
-
-
Augie Fackler authored
-
- May 14, 2018
-
-
David Demelier authored
As part of ConfigConsolidationPlan [1], rename the option according to the new UI guidelines [2] and add an alias for backward compatibility. [1]: https://www.mercurial-scm.org/wiki/ConfigConsolidationPlan [2]: https://www.mercurial-scm.org/wiki/UIGuideline#adding_new_options
-
- May 04, 2018
-
-
Wagner Bruna authored
-
Wagner Bruna authored
-
- May 01, 2018
-
-
Katsunori FUJIWARA authored
-
- Mar 14, 2018
-
-
Augie Fackler authored
This pattern was banned by check-code way back in 1b4b82063ce2 (may of 2011), but due to a regular expression rewriting bug in check-code these particular callsites were never detected. Python 3.7 caught the bug, which then exposed these errors. Differential Revision: https://phab.mercurial-scm.org/D2863
-
- Jan 31, 2018
-
-
Wagner Bruna authored
-
- Dec 02, 2017
-
-
Yuya Nishihara authored
This makes sure that all columns are aligned. getlogcolumns() is hosted by templatekw so the namespaces module can see it. i18n/de.po is updated so test-log.t passes with no error. "obsolete:" and "instability:" are kept untranslated.
-
- Nov 21, 2017
-
-
Wagner Bruna authored
-
- Nov 01, 2017
-
-
Augie Fackler authored
-
Wagner Bruna authored
-
- Oct 23, 2017
-
-
muxator authored
"can only specify one of -C/--clean, -c/--check, or -m/merge" becomes "can only specify one of -C/--clean, -c/--check, or -m/--merge"
-
- Sep 24, 2017
-
-
Yuya Nishihara authored
We do "'%d:%s' % (ctx...)" at several places, so let's formalize it. A low- level function, formatrevnode(ui, rev, node), is extracted so we can pass a manifest rev/node pair. Note that hex() for manifest output can be replaced with hexfunc() because it is printed only when debugflag is set. i18n/de.po is updated so test-log.t passes with no error.
-
- Jul 31, 2017
-
-
Wagner Bruna authored
-
- Aug 22, 2017
-
-
durin42 authored
-
- Aug 15, 2017
-
-
Katsunori FUJIWARA authored
Docstring of modules is needed only for "hg help -e EXTNAME". This is a preparation for applying hggettext on util.py, which has module docstring, but it isn't needed for translation.
-
Katsunori FUJIWARA authored
To list up available compression types instead of ".. bundlecompressionmarker" in "hg help bundlespec" output, proxy object "docobject" is used, because: - current online help system requires that __doc__ of registered object (maybe, function) is already well formatted in reST syntax - bundletype() method of compressionengine classes is used to list up available compression types, but - __doc__ of bundletype() object (= "instancemethod") is read-only On the other hand, hggettext requires original function object, in order to get document location in source code. Therefore, description of each compression types isn't yet translatable. Even if translatable, translators should make much effort to determine location of original texts in source code. To get actual function information, this patch makes hggettext use function object saved as "_origfunc", if it is available. This patch also changes bundlecompressiontopics() side, in order to explain how these changes work easily. This patch is a part of preparations for making description of each compression types translatable.
-
- Aug 13, 2017
-
-
Katsunori FUJIWARA authored
hggettext assumes that backslashes in docstring are always doubled in original source code, in order to find the location of original docstring out certainly. This assumption almost always works as expected. But doctest easily breaks it, because many of backslashes in doctests aren't doubled. This mismatching causes "unknown offset in ..." warning at "make update-pot". To avoid such warning, this patch ignores doctest part of docstring before finding the location of original docstring out. BTW, at this patch, only person() in templatefilters.py has doctest part, which causes "unknown offset ..." warning. Therefore, just making backslashes in that doctest doubled can avoid such warning, too. But forcing doctest writers to double backslashes in doctest isn't reasonable, IMHO.
-
- Aug 01, 2017
-
-
Katsunori FUJIWARA authored
Before this patch, hggettext uses __doc__ of each functions to compute offset of document text. But __doc__ of many functions is already modified by decorators in registrar (e.g. @templatekeyword adds ":NAME: " prefix to it), and hggettext can not find it out in original source. This causes many "unknown offset in ..." warning at "make update-pot", and leaving them might cause overlooking serious problems. This patch makes hggettext use original docstring, which decorators in registrar save into _origdoc, to compute offset. Even after this patch, there are still a few "unknown offset in ..." warning at "make update-pot" for specific reasons. These will be fixed later one by one.
-
- Jun 15, 2017
-
-
Augie Fackler authored
These are all simple one-argument print statements, so this syntax works the same way in 2 and 3. Differential Revision: https://phab.mercurial-scm.org/D276
-
- Aug 01, 2017
-
-
Katsunori FUJIWARA authored
Before this patch, source filename for msgid in hg.pot file becomes incorrect, if a function is defined in file A, but detected in dict in file B, For example, almost all debug* commands are defined in debugcommands.py, but hggettext detects them in "table" of commands.py. Therefore, docstring fragments of debug* commands are marked as "defined in commands.py" in hg.pot file. This is serious problem for translation, because the cost to find out original location of texts increases very much.
-
- Jun 29, 2017
-
-
Wagner Bruna authored
-
- Jun 17, 2017
-
-
Matt Harbison authored
I'm not sure how to test this one. `make update-pot` spews all kinds of warnings, though it did before this change too.
-
- Jun 02, 2017
-
-
Wagner Bruna authored
-
- Jun 01, 2017
-
-
Wagner Bruna authored
-
- May 31, 2017
-
-
Wagner Bruna authored
-
- Apr 30, 2017
-
-
Katsunori FUJIWARA authored
-
- Mar 02, 2017
-
-
Wagner Bruna authored
-
- Mar 01, 2017
-
-
Katsunori FUJIWARA authored
-