Skip to content
Snippets Groups Projects
  1. Oct 06, 2019
    • Gregory Szorc's avatar
      py3: manually import pycompat.open into files that need it · eef9a2d67051
      Gregory Szorc authored
      We want to eliminate the source transformer. Currently it inserts
      a `from mercurial.pycompat import ...` at the top of files to alias
      some builtins.
      
      This commit replaces the implicit import of `open` with an explicit
      import on files that need it and changes the source transformer to
      no longer import `open`.
      
      As part of this, we needed to store an explicit local for `open` in
      the Python 2 code path in `pycompat` so the import works. (Builtins
      that are automatically in scope cannot be imported.)
      
      Differential Revision: https://phab.mercurial-scm.org/D7005
      eef9a2d67051
    • Gregory Szorc's avatar
      import-checker: allow symbol imports from mercurial.pycompat · c2e284cee333
      Gregory Szorc authored
      Currently, the source transformer inserts
      `from mercurial.pycompat import delattr, getattr, hasattr, setattr, open, unicode`
      to the top of every file. As part of getting rid of the source transformer,
      we'll need to have source code call these wrappers directly. Rather than
      rewrite all call sites to call pycompat.*, I think it makes sense to import
      needed symbols via explicit imports. That requires loosening the import checker
      to allow this.
      
      Differential Revision: https://phab.mercurial-scm.org/D7004
      c2e284cee333
    • Augie Fackler's avatar
      contrib: add a fork of black (as "grey") that includes my changes · 7054fd370430
      Augie Fackler authored
      This is black with https://github.com/psf/black/pull/826 applied as of
      today. The current git hash of black master is
      d9e71a75ccfefa3d9156a64c03313a0d4ad981e5, and the hash of my commit is
      dc1add6e94e212eff37bb3619e1422fb3c6d8dc8. In order to use this, you
      need to install `black` (from github master) and `typed-ast` using
      pip, preferably into python3, and then you can run `grey.py` with that
      Python and you'll have my patched version of black, which is how we've
      been formatting the codebase.
      
      Once my PR is merged, I'll follow up by removing this fork and
      updating instructions in the example config.
      
      # no-check-commit bad style
      
      Differential Revision: https://phab.mercurial-scm.org/D7002
      7054fd370430
  2. Oct 05, 2019
    • Yuya Nishihara's avatar
      rust-cpython: change license of ref_sharing.rs to MIT · fdfe5cfb3723
      Yuya Nishihara authored
      Since we plan to upstream this feature, it's better to continue further
      refactoring under the same license as rust-cpython crate.
      
      According to the file history, copyright holders are:
      
       - Raphaël Gomès <rgomes@octobus.net>
       - Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
       - Yuya Nishihara <yuya@tcha.org>
      fdfe5cfb3723
  3. Oct 06, 2019
  4. May 04, 2019
  5. Oct 06, 2019
  6. Oct 05, 2019
    • Augie Fackler's avatar
      style: run a patched black on a subset of mercurial · 57875cf423c9
      Augie Fackler authored
      This applied black to the 20 smallest files in mercurial/:
      
          ls -S1 mercurial/*.py | tail -n20 | xargs black --skip-string-normalization
      
      Note that a few files failed to format, presumably due to a bug in my
      patch. The intent is to be able to compare results to D5064 with
      https://github.com/python/black/pull/826 applied to black.
      
      I skipped string normalization on this patch for clarity - in reality
      I think we'd want one pass without string normalization, followed by
      another to normalize strings (which is basically replacing ' with "
      globally.)
      
      # skip-blame mass-reformatting only
      
      Differential Revision: https://phab.mercurial-scm.org/D6342
      57875cf423c9
  7. Oct 04, 2019
  8. Oct 05, 2019
  9. Oct 04, 2019
  10. Oct 05, 2019
  11. Oct 06, 2019
  12. Oct 05, 2019
  13. Sep 30, 2019
  14. Oct 05, 2019
  15. Oct 04, 2019
Loading