Skip to content
Snippets Groups Projects
  1. May 27, 2019
    • sliquister's avatar
      merge: fix race that could cause wrong size in dirstate · 87a34c76
      sliquister authored
      The problem is that hg merge/update/etc work the following way:
      1. figure out what files to update
      2. apply the update to disk
      3. apply the update to in-memory dirstate
      4. write dirstate
      
      where step3 looks at the filesystem and assumes it sees the result of
      step2. If a file is changed between step2 and step3, step3 will record
      incorrect information in the dirstate.
      
      I avoid this by passing the size step3 needs directly from step2, for
      the common path (not implemented for change/delete conflicts for
      instance).
      
      I didn't fix the same race for the exec bit for now, because it's less
      likely to be problematic and I had trouble due to the fact that the
      dirstate stores the permissions differently from the manifest (st_mode
      vs '' 'l' 'x'), in combination with tests that pretend that symlinks
      are not supported.
      
      However, I moved the lstat from step3 to step2, which should tighten
      the race window markedly, both for the exec bit and for the mtime.
      
      Differential Revision: https://phab.mercurial-scm.org/D6475
      87a34c76
  2. Jun 12, 2019
  3. May 19, 2019
  4. May 23, 2019
    • Georges Racinet's avatar
      rust: new rust options in setup.py · 94167e70
      Georges Racinet authored
      The --rust global option turns on usage (and by default compilation)
      of the rust-cpython based mercurial.rustext.
      
      Similarly to what's previously done for zstd, there is a --no-rust
      option for the build_ext subcommand in order not to build
      mercurial.rustext, allowing for an OS distribution to prebuild it.
      
      The HGWITHRUSTEXT environment variable is still honored, and has
      the same effect as before, but now it works mostly by making
      the --rust global option defaulting to True, with some special
      cases for the direct-ffi case (see more about that below)
      
      Coincidentally, the --rust flag can also be passed from the make
      commands, like actually all global options, in the PURE variable
      
         make local PURE=--rust
      
      This feels inappropriate, though, and we should follow up with
      a proper make variable for that case.
      
      Although the direct-ffi bindings aren't directly useful any more, we
      keep them at this stage because
      
      - they provide a short prototyping path for experiments in which a C extension
        module has to call into a Rust extension. The proper way of doing that would
        be to use capsules, and it's best to wait for our pull request onto
        rust-cpython for that: https://github.com/dgrunwald/rust-cpython/pull/169
      - Build support for capsules defined in Rust will probably need to reuse
        some of what's currently in use for direct-ffi.
      94167e70
  5. May 30, 2019
    • Georges Racinet's avatar
      rust: using policy.importrust from Python callers · a3a8887e
      Georges Racinet authored
      This commit converts all current Python callers of
      mercurial.rustext to the new policy.importrust system.
      
      After this point, going through policy.importrust
      or policy.importmod (in some more distant future)
      is mandatory for callers of Rust code outside of
      Python tests.
      
      We felt it to be appropriate to keep Rust-specific tests
      run inconditionally if the Rust extensions are present.
      a3a8887e
  6. May 29, 2019
    • Georges Racinet's avatar
      rust: module policy with importrust · 810f66b4
      Georges Racinet authored
      We introduce two rust+c module policies and a new
      `policy.importrust()` that makes use of them.
      
      This simple approach provides runtime switching of
      implementations, which is crucial for the performance
      measurements such as those Octobus does with ASV.
      
      It can also be useful for bug analysis.
      
      It also has the advantage of making conditionals in
      Rust callers more uniform, in particular
      abstracting over specifics like `demandimport`
      
      At this point, the build stays unchanged, with the rust-cpython based
      `rustext` module being built if HGWITHRUSTEXT=cpython.
      
      More transparency for the callers, i.e., just using
      `policy.importmod` would be a much longer term and riskier
      effort for the following reasons:
      
      1. It would require to define common module boundaries
         for the three or four cases (pure, c, rust+ext, cffi) and that
         is premature with the Rust extension currently under heavy
         development in areas that are outside the scope of the C extensions.
      2. It would imply internal API changes that are not currently wished,
         as the case of ancestors demonstrates.
      3. The lack of data or property-like attributes (tp_member
         and tp_getset) in current `rust-cpython` makes it impossible to
         achieve direct transparent replacement of pure Python classes by
         Rust extension code, meaning that the caller sometimes has to be able
         to make adjustments or provide additional wrapping.
      810f66b4
  7. Jun 13, 2019
  8. Jun 12, 2019
    • Ian Moody's avatar
      phabricator: use parents.set to always set dependencies · c19d259f
      Ian Moody authored
      Now that Mercurial's Phabricator instance has been updated to a version that
      supports the parents.set transaction on revision.edit we can use that to set
      dependency relationships in patch stacks instead of abusing the summary.
      This has the advantage that we can use it on every `phabsend` so commit
      reordering is picked up without spamming changes like abusing the summary would,
      and using parents.set will clear previous parents unlike parents.add.
      
      Differential Revision: https://phab.mercurial-scm.org/D6514
      c19d259f
  9. May 31, 2019
  10. Jun 10, 2019
    • Kyle Lippincott's avatar
      rebase: tweak description of inmemory working even w/ dirty working dir · cda591d2
      Kyle Lippincott authored
      One of our users was confused because they read this, and then attempted to run
      `hg rebase` with a dirty working directory, and it still complained. The reason
      was that they were attempting to rebase the commit they currently had checked
      out, which (at least with evolve workflows enabled) involves updating the
      working directory to be based on the newly rebased commit.
      
      Differential Revision: https://phab.mercurial-scm.org/D6507
      cda591d2
    • Valentin Gatien-Baron's avatar
      revlog: speed up isancestor · 055c3e2c
      Valentin Gatien-Baron authored
      Currently, it is implemented on top of commonancestorsheads.
      Implement it on top of reachableroots instead, as reachableroots could
      stop walking the graph much sooner than commonancestorsheads.
      
      Measuring repo.changelog.isancestorrev on two revisions in a private repository:
      before: ! wall 0.005175 comb 0.010000 user 0.010000 sys 0.000000 (best of 550)
      after : ! wall 0.000072 comb 0.000000 user 0.000000 sys 0.000000 (best of 36199)
      
      When hg does this kind of operations 1500 times in pull ->
      bookmarks.comparebookmarks -> bookmarks.validdest, that's 11s that
      drop from the --profile output.
      
      Differential Revision: https://phab.mercurial-scm.org/D6506
      055c3e2c
    • Valentin Gatien-Baron's avatar
      dagop: fix documentation of reachableroots · 3e42fc24
      Valentin Gatien-Baron authored
      The previous revset couldn't be correct as it is symmetric in <roots>
      and <heads>, but reachableroots has no such symmetry. It makes a
      difference with for instance reachableroots(2, 3) where 2 and 3 are
      both children of 1.
      
      Differential Revision: https://phab.mercurial-scm.org/D6505
      3e42fc24
  11. Jun 11, 2019
    • Ian Moody's avatar
      phabricator: add --blocker argument to phabsend to specify blocking reviewers · f33d3ee1
      Ian Moody authored
      The way to signal to Conduit that a reviewer is considered blocking is just to
      wrap their PHID in "blocking()" when including it in the list of PHIDs passed
      to `reviewers.add`.
      
      arc doesn't have a --blocker, instead one is supposed to append a '!' to the
      end of reviewer names (I think reviewers are usually added in an editor rather
      than the command line, where '!'s can be more hazardous).
      
      moz-phab (Mozilla's arcanist wrapper) does have a --blocker argument, and being
      explicit like this is also more discoverable. Even `arc diff`'s help doesn't
      seem to mention the reviewer! syntax.
      
      Differential Revision: https://phab.mercurial-scm.org/D6512
      f33d3ee1
    • Ian Moody's avatar
      phabricator: auto-sanitise API tokens and HTTP cookies from VCR recordings · d3c81439
      Ian Moody authored
      Currently when making VCR recordings one needs to manually sanitise sensitive
      credentials before committing and submitting them as part of tests. It is easy
      to imagine this being accidentally missed one time by a fallible human and said
      credentials being leaked. It is also possible that it wouldn't be noticed to
      alert the user to the leak since the recording files are so large and
      practically unreviewable. Thus do so automatically, so the only place that needs
      checking is in the test-phabricator.t file.
      
      Differential Revision: https://phab.mercurial-scm.org/D6513
      d3c81439
    • Pulkit Goyal's avatar
      py3: use .startswith() instead of bytes[0] · c1bf63ac
      Pulkit Goyal authored
      Doing bytes[0] will return the ascii value of that position which breaks
      comparison with a bytechar.
      
      This makes test-absorb.t work again on py3.
      
      Differential Revision: https://phab.mercurial-scm.org/D6508
      c1bf63ac
  12. Jun 09, 2019
  13. Jun 01, 2019
  14. Jun 06, 2019
    • Raphaël Gomès's avatar
      rust-regex: fix shortcut for exact matches · 48f1f864
      Raphaël Gomès authored
      The current shortcut for rootglobs that can be simplified to exact matches
      does not work, it instead treats the pattern as a regex, which is not the
      same thing.
      This changes fixes the behavior and introduces a test for this behavior.
      
      Differential Revision: https://phab.mercurial-scm.org/D6489
      48f1f864
    • Raphaël Gomès's avatar
      rust-filepatterns: use bytes instead of String · 9609430d
      Raphaël Gomès authored
      In my initial patch, I introduced an unnecessary hard constraint on UTF-8
      filenames and patterns which I forgot to remove. Although the performance
       penalty for using String might be negligible, we don't want to break
      compatibility with non-UTF-8 encodings for no reason.
      Moreover, this change allows for a cleaner Rust core API.
      
      This patch introduces a new utils module that is used with this fix.
      
      Finally, PatternError was not put inside the Python module generated by
      Rust, which would have raised a NameError.
      
      Differential Revision: https://phab.mercurial-scm.org/D6485
      9609430d
  15. May 31, 2019
  16. Jun 08, 2019
  17. Jun 07, 2019
  18. Jun 05, 2019
  19. Jun 06, 2019
  20. May 22, 2019
  21. Jun 05, 2019
    • Pierre-Yves David's avatar
      discovery: be more conservative when adjusting the sample size · b9ff059f
      Pierre-Yves David authored
      Since 5b34972a0094, the discovery will increase the sample size when it detect a
      "complex" undecided set. However this detection focussed on the number of roots
      only, this could regress discovery performance when the undecided set has many
      roots that eventually get merged into a few heads.
      
      To prevent such misbehavior, we adjust the logic to take in account both heads
      and roots. The sample size will be increased only if both are especially large.
      
      Performance testing on the same case as 5b34972a0094, does not show a
      significant difference.
      b9ff059f
  22. May 16, 2019
  23. Jun 05, 2019
    • Valentin Gatien-Baron's avatar
      profiling: show actual time spent in hotpath display · 0ae593e7
      Valentin Gatien-Baron authored
      To get, for instance:
      
      ...
       \  6.6%  4.08s  lock.py:        __exit__          line 1566: ...
         |  6.5%  4.01s  exchange.py:    close           line 1191: ...
         |  6.5%  4.01s  transaction.py: _active         line 1443: ...
         |  6.5%  4.01s  transaction.py: close           line 47:   ...
         |  6.2%  3.84s  scmutil.py:     wrapped         line 529:  ...
         |  6.2%  3.81s  localrepo.py:   wrapper         line 2114: ...
         |  6.2%  3.81s  localrepo.py:   updatecaches    line 177:  ...
         ...
      
      instead of:
      
      ...
       \  6.6%  lock.py:        __exit__          line 1566: ...
         |  6.5%  exchange.py:    close           line 1191: ...
         |  6.5%  transaction.py: _active         line 1443: ...
         |  6.5%  transaction.py: close           line 47:   ...
         |  6.2%  scmutil.py:     wrapped         line 529:  ...
         |  6.2%  localrepo.py:   wrapper         line 2114: ...
         |  6.2%  localrepo.py:   updatecaches    line 177:  ...
         ...
      
      I find that if it's not displayed, I frequently end up estimating the
      numbers by hand.
      
      Differential Revision: https://phab.mercurial-scm.org/D6477
      0ae593e7
    • Martin von Zweigbergk's avatar
      merge with stable · 381d8fa5
      Martin von Zweigbergk authored
      381d8fa5
  24. Jun 01, 2019
  25. Jun 05, 2019
  26. Jun 04, 2019
  27. May 22, 2019
Loading