Skip to content
Snippets Groups Projects
  1. Dec 28, 2018
  2. Dec 24, 2018
  3. Dec 10, 2018
    • Gregory Szorc's avatar
      progress: avoid ui.configbool() lookup when progress bar is active · 6603de284b0a
      Gregory Szorc authored
      Profiling revealed that the ui.configbool('progress', 'debug') during
      progress bar updates was consuming a significant amount of overhead.
      
      This commit adds an attribute on progress bar instances that caches
      this config option.
      
      The impact on `hg perfprogress` with default options is significant:
      
      before: ! wall 4.641942 comb 4.580000 user 4.210000 sys 0.370000 (best of 3)
      after:  ! wall 1.948626 comb 1.950000 user 1.950000 sys 0.000000 (best of 5)
      
      After this change, profiling reveals that progress.progbar.progress()
      is now consuming ~73% of time.
      
      This change does not improve the execution time if the progress bar
      is disabled. We may want a more comprehensive solution for that case,
      as the progress bar won't be enabled in a number of scenarios (e.g.
      servers and processes not attached to an interactive TTY).
      
      I also think that overhead of ~2.0s for 1M updates is a bit high.
      I suspect further refactoring of the progress bar can significantly
      reduce overhead. I don't have plans to do this, however.
      
      Differential Revision: https://phab.mercurial-scm.org/D5408
      6603de284b0a
  4. Dec 24, 2018
    • Matt Harbison's avatar
      largefiles: port wrapped functions to exthelper · 0a7f582f6f1f
      Matt Harbison authored
      Things get interesting in the commit.  I hadn't seen issue6033 on Windows, and
      yet it is now reproducible 100% of the time on Windows 10 with this commit.  I
      didn't test Linux.  (For comparison, after seeing this issue, I tested on the
      parent with --loop, and it failed 5 times out of over 1300 tests.)
      
      The strange thing is that largefiles has nothing to do with that test (it's not
      even mentioned there).  It isn't autoloading run amuck- it occurs even if
      largefiles is explicitly disabled, and also if the entry in afterhgrcload() is
      commented out.  It's also not the import of lfutil- I disabled that by copying
      the function into lfs and removing the import, and the problem still occurs.
      
      Experimenting further, it seems that the problem is isolated to 3 entries:
      exchange.pushoperation, hg.clone, and cmdutil.revert.  If those decorators are
      all commented out, the test passes when run in a loop for awhile.  (Obviously,
      some largefiles tests will fail.)  But if any one is commented back in, the test
      fails immediately.
      
      I left one method related to wrapping the wire protocol, because it seemed more
      natural with the TODO.  Also, exthelper doesn't support wrapping functions from
      another extension, only commands in another extension.  I didn't try to figure
      out why rebase is both command wrapped and function wrapped.
      0a7f582f6f1f
  5. Dec 23, 2018
  6. Dec 24, 2018
    • Matt Harbison's avatar
      exthelper: support the option argument when registering a command · 7250cbaabde0
      Matt Harbison authored
      Largefiles uses this 5th argument with push and pull, so this will be tested in
      the next commit.  I assume the reason for unrolling and reforming the tuple in
      each finalxxxsetup() is to validate that something proper was passed in when
      registering.  But it's better to explode when decorating than during the delayed
      actual registration.
      7250cbaabde0
  7. Dec 23, 2018
  8. Dec 27, 2018
  9. Dec 24, 2018
    • sliquister's avatar
      wireproto: in batch queries, support queries with immediate responses · 55e8da487b8a
      sliquister authored
      listkeys and pushkey return without querying the remote when the
      remote doesn't support such queries. Before this change, the batching
      code didn't handle this convention, resulting in this kind of error:
      
        $ hg pull ssh://user@dummy/repo1 -r tip -B a
        pulling from ssh://user@dummy/repo1
        remote: ** Unknown exception encountered with possibly-broken third-party extension disable-lookup
        remote: ** which supports versions unknown of Mercurial.
        remote: ** Please disable disable-lookup and try your action again.
        remote: ** If that fixes the bug please report it to the extension author.
        remote: ** Python 2.7.15+ (default, Oct  2 2018, 22:12:08) [GCC 8.2.0]
        remote: ** Mercurial Distributed SCM (version 4.8.1+586-ef54bd33b476+20181224)
        remote: ** Extensions loaded: disable-lookup
        remote: Traceback (most recent call last):
        remote:   File "/tmp/hgtests.i66Npc/install/bin/hg", line 43, in <module>
        remote:     dispatch.run()
        remote:   File "/tmp/hgtests.i66Npc/install/lib/python/mercurial/dispatch.py", line 99, in run
        remote:     status = dispatch(req)
        remote:   File "/tmp/hgtests.i66Npc/install/lib/python/mercurial/dispatch.py", line 225, in dispatch
        remote:     ret = _runcatch(req) or 0
        remote:   File "/tmp/hgtests.i66Npc/install/lib/python/mercurial/dispatch.py", line 376, in _runcatch
        remote:     return _callcatch(ui, _runcatchfunc)
        remote:   File "/tmp/hgtests.i66Npc/install/lib/python/mercurial/dispatch.py", line 384, in _callcatch
        remote:     return scmutil.callcatch(ui, func)
        remote:   File "/tmp/hgtests.i66Npc/install/lib/python/mercurial/scmutil.py", line 166, in callcatch
        remote:     return func()
        remote:   File "/tmp/hgtests.i66Npc/install/lib/python/mercurial/dispatch.py", line 367, in _runcatchfunc
        remote:     return _dispatch(req)
        remote:   File "/tmp/hgtests.i66Npc/install/lib/python/mercurial/dispatch.py", line 1021, in _dispatch
        remote:     cmdpats, cmdoptions)
        remote:   File "/tmp/hgtests.i66Npc/install/lib/python/mercurial/dispatch.py", line 756, in runcommand
        remote:     ret = _runcommand(ui, options, cmd, d)
        remote:   File "/tmp/hgtests.i66Npc/install/lib/python/mercurial/dispatch.py", line 1030, in _runcommand
        remote:     return cmdfunc()
        remote:   File "/tmp/hgtests.i66Npc/install/lib/python/mercurial/dispatch.py", line 1018, in <lambda>
        remote:     d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
        remote:   File "/tmp/hgtests.i66Npc/install/lib/python/mercurial/util.py", line 1670, in check
        remote:     return func(*args, **kwargs)
        remote:   File "/tmp/hgtests.i66Npc/install/lib/python/mercurial/commands.py", line 5257, in serve
        remote:     s.serve_forever()
        remote:   File "/tmp/hgtests.i66Npc/install/lib/python/mercurial/wireprotoserver.py", line 797, in serve_forever
        remote:     self.serveuntil(threading.Event())
        remote:   File "/tmp/hgtests.i66Npc/install/lib/python/mercurial/wireprotoserver.py", line 804, in serveuntil
        remote:     _runsshserver(self._ui, self._repo, self._fin, self._fout, ev)
        remote:   File "/tmp/hgtests.i66Npc/install/lib/python/mercurial/wireprotoserver.py", line 656, in _runsshserver
        remote:     rsp = wireprotov1server.dispatch(repo, proto, request)
        remote:   File "/tmp/hgtests.i66Npc/install/lib/python/mercurial/wireprotov1server.py", line 74, in dispatch
        remote:     return func(repo, proto, *args)
        remote:   File "/tmp/hgtests.i66Npc/install/lib/python/mercurial/wireprotov1server.py", line 195, in batch
        remote:     data[k] = vals[k]
        remote: KeyError: 'namespace'
        abort: unexpected response: empty string
        [255]
      
      Differential Revision: https://phab.mercurial-scm.org/D5482
      55e8da487b8a
  10. Dec 04, 2018
  11. Dec 06, 2018
  12. Dec 03, 2018
    • Georges Racinet's avatar
      rust-cpython: implement Graph using C parents function · 4c25038c112c
      Georges Racinet authored
      We introduce the `Index` struct that wraps the C index. It is
      not intrinsically protected by the GIL (see the lengthy
      discussion in its docstring). Improving on this seems
      prematurate at this point.
      
      A pointer to the parents function is stored on the parsers
      C extension module as a capsule object.
      
      This is the recommended way to export a C API for consumption
      from other extensions.
      See also: https://docs.python.org/2.7/c-api/capsule.html
      
      In our case, we use it in cindex.rs, retrieving function
      pointer from the capsule and storing it within the CIndex
      struct, alongside with a pointer to the index. From there,
      the implementation is very close to the one from hg-direct-ffi.
      
      The naming convention for the capsule is inspired from the
      one in datetime:
      
        >>> import datetime
        >>> datetime.datetime_CAPI
        <capsule object "datetime.datetime_CAPI" at 0x7fb51201ecf0>
      
      although in datetime's case, the capsule points to a struct holding
      several type objects and methods.
      
      Differential Revision: https://phab.mercurial-scm.org/D5438
      4c25038c112c
  13. Dec 21, 2018
    • sliquister's avatar
      pull: fix inconsistent view of bookmarks during pull (issue4700) · bad05a6afdc8
      sliquister authored
      I had a share where a pull apparently pulled a bookmark but not the
      revision pointed to by the bookmark, which I suspect is due to this
      (and if not, we might as well remove known issues in this area).
      
      I do this by combining doing all the queries that could read the
      bookmarks in one round trip.
      
      I had to change the handling of the case where the server doesn't
      support the lookup query, because if it fails, it would otherwise make
      fremotebookmark.result() block forever. This is due to
      wireprotov1peer.peerexecutor.sendcommands's behavior (it fills a
      single future if any query fails synchronously and leaves all other
      futures unchanged), but I don't know if the fix is to cancel all other
      futures, or to keep going with the other queries.
      
      Differential Revision: https://phab.mercurial-scm.org/D5449
      bad05a6afdc8
  14. Dec 23, 2018
  15. Nov 28, 2018
    • Matt Harbison's avatar
      lfs: convert to using exthelper to wrap functions · 84d61fdcefa5
      Matt Harbison authored
      I'm not 100% sure that upgraderequirements() can be double annotated safely, but
      it seems OK based on printing the address of the function being wrapped.
      
      One thing I've noticed is that @eh.reposetup doesn't do the usual check to
      ensure that it's a local repo.  Should that be baked into @eh.reposetup()
      somehow, possibly with a non-default option to skip the check?  It seems like a
      gaping hole if every function that gets registered needs to add this check.
      84d61fdcefa5
  16. Dec 01, 2018
  17. Dec 23, 2018
    • Matt Harbison's avatar
      exthelper: drop fileset/revset/template support for now · f5ec93f69171
      Matt Harbison authored
      Yuya raised concerns about duplicating registrar functionality.  There are a
      couple of ideas to work around this, which would allow bringing them back, and
      then backporting to evolve.  For now, I just want to get the subsequent changes
      landed before the bulk b'' rewrite makes rebasing too hard.
      f5ec93f69171
    • Matt Harbison's avatar
      exthelper: simplify configitem registration · c1476d095d57
      Matt Harbison authored
      c1476d095d57
    • Matt Harbison's avatar
      extensions: import the exthelper class from evolve 980565468003 (API) · fe606f2dcae9
      Matt Harbison authored
      This should help make extensions that wrap a lot of stuff more comprehendible.
      It was copied unmodified, except:
      
        - fix up the imports
        - rename final_xxxsetup() -> finalxxxsetup() to appease checkcode
        - avoid a [] default arg to wrapcommand()
      
      .. api::
      
         Add `exthelper` class to simplify extension writing by allowing functions,
         commands, and configitems to be registered via annotations.  The previous
         APIs are still available for use.
      fe606f2dcae9
  18. Dec 21, 2018
  19. Jul 13, 2018
  20. Dec 10, 2018
  21. Oct 28, 2018
    • Martin von Zweigbergk's avatar
      tests: update narrowspec when narrowspec, not dirstate, is accessed · 92fde28860bb
      Martin von Zweigbergk authored
      test-narrow-expanddirstate.t mimics a Google-internal extension that
      updates the narrowspec whenever the dirstate is accessed. Since
      1d09ba0d2ed3 (narrow: move remaining narrow-limited dirstate walks to
      core, 2018-10-01) and a few commits before it, we no longer restrict
      repo.dirstate.walk() to the narrowspec. It is instead done at a higher
      level (e.g. context.status()). We were running into problems with the
      Google-internal extension when importing those commits. The issue was
      that the narrowspec was read before the first dirstate access. I
      believe the right fix is to instead update the narrowspec when trying
      to read it (not when reading the dirstate), so that's what this patch
      does.
      
      Differential Revision: https://phab.mercurial-scm.org/D5275
      92fde28860bb
  22. Dec 21, 2018
  23. Dec 04, 2018
  24. Dec 22, 2018
  25. Dec 19, 2018
  26. Dec 21, 2018
  27. Dec 20, 2018
  28. Dec 19, 2018
    • Boris Feld's avatar
      revlog: limit base to rev size ratio to 500 instead of 50 · b373477948df
      Boris Feld authored
      While a value of 50 provided large speedup in some case (400s → 7s) it also
      creates a slow down for a whole class of revision we are seeing in a private
      repository (0.1s → 3s). A value of 500 makes them disappear improving the
      total runtime (the slower revision still improve significantly (400s → 21s)).
      
      We need to run a wider array of tests on various repositories to see the
      effect on speed and size of different values for this acceptable constant.
      However, in the meantime, it seems safer to move back to a less impactful
      value.
      b373477948df
  29. Dec 21, 2018
  30. Dec 20, 2018
  31. Dec 18, 2018
Loading