- Feb 21, 2022
-
-
Gregory Szorc authored
The inheritance from object is implied in Python 3. So this should be equivalent. This change was generated via an automated search and replace. So there may have been some accidental changes. Differential Revision: https://phab.mercurial-scm.org/D12352
-
- Mar 03, 2022
-
-
Gregory Szorc authored
These were needed for Python 2 support. Now that our linter no longer mandates these, we can start deleting them. Differential Revision: https://phab.mercurial-scm.org/D12254
-
- 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
-
- 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
-
- 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
-
- 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.
-
- Jul 03, 2016
-
-
Pulkit Goyal authored
This patch includes addition of absolute_import and print_function to the files where they are missing. The modern importing conventions are also followed.
-
- Jun 24, 2015
-
-
Gregory Szorc authored
Python 2.6 introduced the "except type as instance" syntax, replacing the "except type, instance" syntax that came before. Python 3 dropped support for the latter syntax. Since we no longer support Python 2.4 or 2.5, we have no need to continue supporting the "except type, instance". This patch mass rewrites the exception syntax to be Python 2.6+ and Python 3 compatible. This patch was produced by running `2to3 -f except -w -n .`.
-
- Mar 13, 2015
-
-
Jordi Gutiérrez Hermoso authored
Although Python supports `X = Y if COND else Z`, this was only introduced in Python 2.5. Since we have to support Python 2.4, it was a very common thing to write instead `X = COND and Y or Z`, which is a bit obscure at a glance. It requires some intricate knowledge of Python to understand how to parse these one-liners. We change instead all of these one-liners to 4-liners. This was executed with the following perlism: find -name "*.py" -exec perl -pi -e 's,(\s*)([\.\w]+) = \(?(\S+)\s+and\s+(\S*)\)?\s+or\s+(\S*)$,$1if $3:\n$1 $2 = $4\n$1else:\n$1 $2 = $5,' {} \; I tweaked the following cases from the automatic Perl output: prev = (parents and parents[0]) or nullid port = (use_ssl and 443 or 80) cwd = (pats and repo.getcwd()) or '' rename = fctx and webutil.renamelink(fctx) or [] ctx = fctx and fctx or ctx self.base = (mapfile and os.path.dirname(mapfile)) or '' I also added some newlines wherever they seemd appropriate for readability There are probably a few ersatz ternary operators still in the code somewhere, lurking away from the power of a simple regex.
-
- Apr 17, 2014
-
-
Mads Kiilerich authored
-
- Apr 17, 2013
-
-
Mads Kiilerich authored
Better do it once than see random changes in diffs later.
-
- Oct 17, 2011
-
-
Wagner Bruna authored
This version fixes some upstream issues observed during the pt_BR translation update: #8 (obsolete entries reappearing); an unidentified issue that made i18n/posplit produce some spurious messages on the resulting po file; possibly others. These bugs probably didn't cause actual differences on the translated output, since an invalid message added to the .mo file wouldn't match an input message most of the time. But they do pollute the .po file contents (and diffs), adding some confusion to the translation process. db957a72fbd7, 4c50552fc9bc and 8ea51e9e7031 were included upstream, so the only remaining difference is the "no-check-code" marking.
-
- Nov 22, 2010
-
-
Martin Geisler authored
Submitted to upstream repository as changeset f11e0b1b37b0.
-
- Oct 26, 2010
-
-
Dan Villiom Podlaski Christiansen authored
-
- Jun 22, 2010
-
-
Matt Mackall authored
-
- Jun 19, 2010
-
-
Martin Geisler authored
Patch submitted to upstream as rev b9174a342092 in http://bitbucket.org/mg/polib/
-
- Jun 17, 2010
-
-
Wagner Bruna authored
-