Skip to content
Snippets Groups Projects
  1. Dec 03, 2018
    • Georges Racinet's avatar
      rust-cpython: start cpython crate bindings · 5532823e8c18
      Georges Racinet authored
      This changeset introduces the hg-cpython crate,
      that compiles as a shared library holding a whole
      Python package (mercurial.rustext), with only the empty
      'ancestor' submodule for now.
      
      Such bindings will be easier and safer to develop and maintain
      that those of `hg-direct-ffi`.
      They don't involve C code, only unsafe Rust that's mostly isolated
      within the cpython crate.
      
      The long-term goal would be to import the provided modules, such
      as rustext.ancestor with mercurial.policy.importmod, same as
      we already do with cext modules.
      
      Differential Revision: https://phab.mercurial-scm.org/D5434
      5532823e8c18
    • Georges Racinet's avatar
      rust-cpython: exclude hgcli from workspace · 98a0fbda8739
      Georges Racinet authored
      hgcli uses a specific rust-cpython commit by indygreg, of which
      a PR has been derived which is not merged nor released yet.
      
      But we can't use several versions of the sys-python2.7 crate in
      a single workspace: it makes for a build error. Since hgcli does not at
      the time being need anything from hg-core, whereas the upcoming hg-cpython
      will. So for now we're moving hgcli aside, hoping we could base all of them
      on the same version of rust-cpython again in the future.
      
      Differential Revision: https://phab.mercurial-scm.org/D5433
      98a0fbda8739
  2. Dec 14, 2018
  3. Nov 29, 2018
    • Georges Racinet's avatar
      rust: translation of missingancestors · d097dd0afc19
      Georges Racinet authored
      This is as direct as possible a translation of the ancestor.missingancestors
      Python class in pure Rust. The goal for this changeset is to make it easy
      to compare with the Python version.
      
      We also add to Python tests the cases that helped us develop and debug
      this implementation.
      
      Some possible optimizations are marked along the way as TODO comments
      
      Differential Revision: https://phab.mercurial-scm.org/D5416
      d097dd0afc19
  4. Dec 14, 2018
  5. Dec 06, 2018
    • Boris Feld's avatar
      delta: filter nullrev out first · f960c51eebf3
      Boris Feld authored
      When picking a potential candidate, we filter them on various criteria. The
      "different from nullrev" criteria is very fast to compute and we should
      process it first.
      f960c51eebf3
    • Boris Feld's avatar
      perf: report more of the higher range in perfrevlogwrite · 74ee5ff1e81c
      Boris Feld authored
      Since the delta chain length is limited to 1000 revisions, we get a new
      snapshot about every 1000 revisions. If we assume that the snapshot will be
      most of the slowest revision, the current display (99% and max) are not very
      precise in their area. We now include more information about this space in the
      default report.
      74ee5ff1e81c
  6. Dec 14, 2018
  7. Dec 13, 2018
  8. Dec 12, 2018
  9. Nov 29, 2018
  10. Dec 11, 2018
  11. Dec 13, 2018
    • Anton Shestakov's avatar
      revset: move subscript relation functions to its own dict · e54bfde922f2
      Anton Shestakov authored
      This will help adding more relation functions in extensions.
      
      We skip short names (that consist of one letter) while raising
      UnknownIdentifier because such names cannot be suggested anyway: the similarity
      cutoff in dispatch._getsimilar() is currently 0.6.
      e54bfde922f2
    • Matt Harbison's avatar
      py3: teach run-tests.py to handle exe with spaces when --local isn't specified · fcdff048a8e5
      Matt Harbison authored
      This was the reason that no amount of quoting worked in test-hghave.t.
      
      `os.popen()` needed to be swapped out because while the added quoting around
      line 3124 worked on py3, it failed on py2.  See 38d51371792b.  The problem with
      `os.system()` was wrongly splitting the command on the space in 'Program Files',
      regardless of quoting.  It looks like there are a few other instances of
      `os.system()` in core code, so presumably those should be replaced?
      fcdff048a8e5
  12. Dec 11, 2018
  13. Dec 12, 2018
  14. Dec 11, 2018
  15. Dec 12, 2018
  16. Dec 10, 2018
    • Gregory Szorc's avatar
      perf: add perfprogress command · 008f3491dc53
      Gregory Szorc authored
      I've noticed that progress bars can add significant overhead to tight
      loops. Let's add a perf command that attempts to isolate that overhead.
      
      With a default hgrc, iteration over 1M items appears to take ~3.75s on
      my machine. Profiling reveals ~28% of time is spent in ui.configbool()
      resolving the value of the progress.debug config option.
      
      Even if I set progress.disable=true, execution still takes ~2.60s, with
      ~59% of the time spent in ui.configbool().
      
      Differential Revision: https://phab.mercurial-scm.org/D5407
      008f3491dc53
    • Gregory Szorc's avatar
      wireprotov2: unify file revision collection and linknode derivation · 08cfa77d7288
      Gregory Szorc authored
      The old mechanism for choosing which file revisions to send in the
      haveparents=True case was buggy in multiple ways - the most severe
      of which being that file revisions were excluded when they shouldn't
      have been.
      
      This commit unifies the logic for deriving the filenodes that will
      be sent by the "filesdata" command. We now consistently read files
      data from manifests. The "haveparents" argument now controls whether
      we iterate ctx.files() or use the full manifest to derive relevant
      files.
      
      The logic here is still woefully lacking to fully support shallow
      clones. It will require an API break to fully address. This commit
      should at least make the server APIs emit proper data, which is
      strictly better than before.
      
      Differential Revision: https://phab.mercurial-scm.org/D5406
      08cfa77d7288
    • Gregory Szorc's avatar
      wireprotov2: send linknodes to emitfilerevisions() · 3ed77780f4a6
      Gregory Szorc authored
      Previously, linknodes were calculated within emitfilerevisions() by
      using filectx.introrev(), which would always use the linkrev/linknode
      as recorded by storage. This is wrong for cases where the receiver
      doesn't have the changeset the linknode refers to.
      
      This commit changes the logic for linknode emission so the mapping
      of filenode to linknode is computed by the caller and passed into
      emitfilerevisions().
      
      As part of the change, linknodes for "filesdata" in the
      haveparents=False case are now correct: the existing code performed a
      manifest walk and it was trivial to plug in the correct linknode.
      
      However, behavior for the haveparents=True case is still wrong
      because it relies on filtering linkrevs against the outgoing set in
      order to determine what to send. This will be fixed in a subsequent
      commit.
      
      The change test test-wireproto-exchangev2-shallow.t is a bit wonky.
      The test repo has 6 revisions. The changed test is performing a shallow
      clone with depth=1. So, only file data for revision 5 is present
      locally. So, the new behavior of associating the linknode with
      revision 5 for every file revision seems correct. Of course, when
      backfilling old revisions, we'll want to update the linknode. But
      this problem requires wire protocol support and we'll cross that
      bridge later.
      
      Differential Revision: https://phab.mercurial-scm.org/D5405
      3ed77780f4a6
    • Gregory Szorc's avatar
      tests: add tests for server-side linknode adjustment with wireprotov2 · ca6372b7e566
      Gregory Szorc authored
      The current implementation of linknode serving in wireprotov2 simply
      serves up the linkrev/linknode as stored: it doesn't attempt to
      adjust the linknode to what the receiver is aware of. This can result
      in the client seeing a linknode referencing a changeset that is unknown
      to it.
      
      This commit adds test coverage of that scenario.
      
      The tests in test-wireproto-command-filesdata.t demonstrate two failures.
      First, the linknode refers to a changeset not in the available set.
      Second, the server doesn't send a file revision that it should have
      (because of linkrev filtering).
      
      The test in test-wireproto-exchange.t demonstrates that the lack of
      a file revision results in a corrupted repository on the client.
      
      Differential Revision: https://phab.mercurial-scm.org/D5404
      ca6372b7e566
Loading